font_factor is not applied to all text in a page. You can test this by setting it to a very low or very high value in your dillorc, looking around at a bunch of pages, and finding that some text is still normal-sized. In addition, font_factor is used to modify the size of GUI elements, which I think is a bad idea, since unlike pages, the GUI doesn't change its layout to account for the new font sizes. Also, not all GUI elements have font_factor applied to them, and those that do don't account for font_min_size or font_max_size. My patch fixes those issues my making it so the GUI elements ignore font_factor, and the style engine takes font_factor into account for px and mm/cm/etc. units: diff --git a/src/dialog.cc b/src/dialog.cc index 3f031834..5517fd65 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -336,7 +336,7 @@ void a_Dialog_text_window(const char *title, const char *txt) buf->text(txt); Fl_Text_Display *td = new Fl_Text_Display(0,0,ww, wh-bh); td->buffer(buf); - td->textsize((int) rint(14.0 * prefs.font_factor)); + td->textsize(14); /* enable wrapping lines; text uses entire width of window */ td->wrap_mode(Fl_Text_Display::WRAP_AT_BOUNDS, 0); @@ -396,7 +396,7 @@ int a_Dialog_choice(const char *title, const char *msg, ...) buf->text(msg); Fl_Text_Display *td = new Fl_Text_Display(0, 0, ww, wh - bh); td->buffer(buf); - td->textsize((int) rint(14.0 * prefs.font_factor)); + td->textsize(14); td->wrap_mode(Fl_Text_Display::WRAP_AT_BOUNDS, 0); window->resizable(td); diff --git a/src/styleengine.cc b/src/styleengine.cc index ef8ab3c0..c43ba948 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -442,8 +442,11 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props, assert(false); // invalid font-size enum } } else { - computeValue (&fontAttrs.size, p->value.lenVal, parentFont, - parentFont->size); + if (computeValue (&fontAttrs.size, p->value.lenVal, parentFont, + parentFont->size) && + (CSS_LENGTH_TYPE(p->value.lenVal) == CSS_LENGTH_TYPE_PX || + CSS_LENGTH_TYPE(p->value.lenVal) == CSS_LENGTH_TYPE_MM)) + fontAttrs.size *= prefs.font_factor; } if (fontAttrs.size < prefs.font_min_size) diff --git a/src/ui.cc b/src/ui.cc index 89b4ae55..8de01ade 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -527,7 +527,7 @@ void UI::make_location(int ww) i->when(FL_WHEN_ENTER_KEY); i->callback(location_cb, this); i->set_tooltip("Location"); - i->textsize((int) rint(14.0 * prefs.font_factor)); + i->textsize(14); p_xpos += i->w(); LocationGroup->box(FL_THIN_UP_BOX); // or FL_FLAT_BOX LocationGroup->end();
participants (1)
-
256@256-32.com