| 5036 | } |
| 5037 | |
| 5038 | staticfn int |
| 5039 | pfxfn_font(int optidx, int req, boolean negated, char *opts, char *op) |
| 5040 | { |
| 5041 | int opttype = -1; |
| 5042 | |
| 5043 | if (req == do_init) { |
| 5044 | return optn_ok; |
| 5045 | } |
| 5046 | |
| 5047 | if (req == do_set) { |
| 5048 | /* WINCAP setting font options */ |
| 5049 | if (optidx == opt_font_map) |
| 5050 | opttype = MAP_OPTION; |
| 5051 | else if (optidx == opt_font_message) |
| 5052 | opttype = MESSAGE_OPTION; |
| 5053 | else if (optidx == opt_font_text) |
| 5054 | opttype = TEXT_OPTION; |
| 5055 | else if (optidx == opt_font_menu) |
| 5056 | opttype = MENU_OPTION; |
| 5057 | else if (optidx == opt_font_status) |
| 5058 | opttype = STATUS_OPTION; |
| 5059 | else if (optidx == opt_font_size_map |
| 5060 | || optidx == opt_font_size_message |
| 5061 | || optidx == opt_font_size_text |
| 5062 | || optidx == opt_font_size_menu |
| 5063 | || optidx == opt_font_size_status) { |
| 5064 | if (optidx == opt_font_size_map) |
| 5065 | opttype = MAP_OPTION; |
| 5066 | else if (optidx == opt_font_size_message) |
| 5067 | opttype = MESSAGE_OPTION; |
| 5068 | else if (optidx == opt_font_size_text) |
| 5069 | opttype = TEXT_OPTION; |
| 5070 | else if (optidx == opt_font_size_menu) |
| 5071 | opttype = MENU_OPTION; |
| 5072 | else if (optidx == opt_font_size_status) |
| 5073 | opttype = STATUS_OPTION; |
| 5074 | else { |
| 5075 | config_error_add("Unknown %s parameter '%s'", |
| 5076 | allopt[optidx].name, opts); |
| 5077 | return optn_err; |
| 5078 | } |
| 5079 | if (duplicate) |
| 5080 | complain_about_duplicate(optidx); |
| 5081 | if (opttype > 0 && !negated |
| 5082 | && (op = string_for_opt(opts, FALSE)) != empty_optstr) { |
| 5083 | switch (opttype) { |
| 5084 | case MAP_OPTION: |
| 5085 | iflags.wc_fontsiz_map = atoi(op); |
| 5086 | break; |
| 5087 | case MESSAGE_OPTION: |
| 5088 | iflags.wc_fontsiz_message = atoi(op); |
| 5089 | break; |
| 5090 | case TEXT_OPTION: |
| 5091 | iflags.wc_fontsiz_text = atoi(op); |
| 5092 | break; |
| 5093 | case MENU_OPTION: |
| 5094 | iflags.wc_fontsiz_menu = atoi(op); |
| 5095 | break; |
no test coverage detected