[Interest] cross-language matching of QStrings: partial success only?
René J.V. Bertin
rjvbertin at gmail.com
Tue May 12 10:49:42 CEST 2015
On Tuesday May 12 2015 08:08:57 Till Oliver Knoll wrote:
Hi,
>And we even haven't yet talked about X11 font formats ;) (altough there it might actually be /simpler/).
Should that read "tongue-in-cheek simpler"? Because from what I remember, it isn't simple at all (is there even a "hard" standard on how many components a name should have?). Clearer, yes: at least you can put in wildcards that make it clear immediately that you're not expecting to get an exact match :)
>I have never heard about "Universally Unique Font Style Enums" and in my memory font matching was always a "fuzzy thing".
That's probably true, despite OpenType which I thought was intended to improve matters in this aspect. It's also something most of us are (or at least were :)) accustomed to when taking a document from one OS to another, or even from one computer to another running the same OS but with a different font collection.
However, I think there is no reason why we'd have to accept "brittle" matching (be it fuzzy or not) on a single machine. Or that certain fonts just don't show up (as described in another recent email on this ML).
>
>But the good news seems to be that you are working "under the hood", so you have access to more powerful font APIs which might help.
Misunderstanding: for now I'm mostly under Qt's hood, and I increasingly have the impression that I am just adding cards (and pins and duct tape) to the existing card house.
What I have been doing is take stock of the weight "enums" that the OS X APIs make available, assuming that does at least correspond to something standard. That's allowed me to fine-tune some of the lookup tables used in Qt's code. And on OS X there's some relevant code in the platform plugin in which I've been able to use native API calls to verify and where needed correct the results of the Qt API.
Writing this I realise that may actually be used only when presenting a font selection dialog with a preselected font.
>The bad news is probably that you have to deal with those non-Qt APIs ;)
The actual bad news in that is that that may require substantial changes to the code base, like adding platform-specific files. Doing things properly seems a bigger challenge than what I have the resources for.
I also am beginning to question the design choice of having Qt's own font style/weight enums (Qt::Normal, Qt::Medium etc) and use them internally for loading fonts, rather than sticking to a numeric scale.
> Hey, just while googling for "win32 english font name" I stumbled over:
> http://trigeminal.fmsinc.com/samples/font_choices.html
>
> It doesn't tell us much what we don't know already, but illustrates again
Interesting, and exactly as I thought indeed. I almost set my OS X environment to one of those languages yesterday to see how things behave then, but for some reason I was hesitant to go through with it :)
> The font should be made to either accept only one name worldwide, or all
> names worldwide.... not to accept a different name depending on the
> machine's locale."
Well, the font doesn't "do" anything (font files are like source code); it's up to the host APIs to make use of the information provided by the font in an appropriate way.
> In effect, the (short) article provides a translation table English <->
> Chinese (?) font names ;)
But it says nothing about styles and weights at all, sadly.
> But it shows that we are on the "right track"... :/
We? Are we?
Cheers,
R.
More information about the Interest
mailing list