Am 13.04.2009 11:06 Uhr schrieb "MacArthur, Ian (SELEX GALILEO, UK)" unter
<[email protected]>:
> I just like to say that my fl_text_extents patch was inspired by a lot
> of the issues Matthias identified with current font handling.
Yes, the fl_text_extents is the perfect tool for verifying what I plan. I
will try to avoid loading multiple fonts and choosing the one closest to
what I need based on text_extents though. Reading about Unicode, loading a
new font seems to be a huge deal... .
> Basically,
> when you ask for a font, you get what the platform's font engine thinks
> you asked for - the text_extents stuff allows you to find out how big
> that will actually be on the screen...
> But that can be a slow thing to do, I don't think we can realistically
> measure every string in that fashion[1].
> It does seem that the current crop of text rendering engines try very
> hard to render something, as best they are able, and often substituting
> whatever font *they* think is a good match for what you actually asked
> for. This does seem to result in text that isn't quite what you asked
> for.
Yeah, isn't that great :-/
> This is made worse (I suspect) by us not selecting the fonts
> consistently anyway.
> I think that some of our font selection code is probably asking for
> fonts in units other than pixels, so we get some variation in heights
> there, too.
>
> This whole is made worse, of course, by the fact that we can not know
> what fonts a user has installed anyway, so even common faces like
> "courier" can appear quite different between machines...
It is a mess, admittedly, on the hosts. :-(
> In the first instance, if we can ensure we are using the font metrics
> consistently (i.e. always pixels or always points or whatever) that
> would be a start. Some of the other issues might not be fixable at all?
We may have to do some platform lookup table, may even one that is sensibly
updated at run-time by whatever FLTK application is active. I wonder if that
is feasible at all. We are drifting into a preferences/FLTK-wide sttings
panel here which may or may not make sense. I'll spend some time tonight
figuring that one out ;-)
Matthias
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev