The Artima Developer Community
Sponsored Link

Agile Buzz Forum
I Understand

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
I Understand Posted: Mar 30, 2005 10:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: I Understand
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement

Well, I got Japanese working. At least kind of. One of the problems that I had to deal with was the font matching algorithm. There's this hook in the Locale framework to cause serif matching to be turned off in certain cases. I presume this is yet another part of the Locale framework that was added just for good old Japanese. In fact, a good half of what a Locale is, looks like it's there to support Japanese. The reason you want to ignore serif, is because there really isn't any sense of "serifness" to japanese character sets. So you just want to leave it out of the algorithm completely.

Well, it turns out that not only is serifness a nonexistent attribute for a Japanese font, under Linux, from all of the TrueType fonts and the like I could find for Japanese, there's never any bold or italic variants. So if you have a text style that searches multiple families, it will skip your japanese family and match another family instead. To get it working for now, I modified the XFont>parse: method. There's a clause in there, where certain encodings, the fixedWidth: attribute is nil'd. I just extended that clause to do the same with bold and italic.

I do note that a much simpler more straightforward font matching algorithm might have dealt better with this. The CSS one would have got it right.

When one specifies a font query, the boldness gets one value, as do all of the other attributes, except family. For that you can presents a list of candidates. This creates an ambiguity. If it can get the first family, but not all of the other attributes match exactly, should it move to the next family, and use it? Or not? The VW algorithm tries to be "fuzzy" about it. CSS is explicit about it's rules. XFT allows the query language to spell out a little more clearly what exactly your priorities are.

Another problem that became apparent in this excercise was that the current mechanism of allowing the Locale to specify certain attributes, to be later unioned with the application specified font is not that robust. IOW, I have a logical font specification via a TextAttributes. But what that is is dependent on the target locale. But they depend on the application as well (e.g. it's not just a matter of modifying #systemDefault).

Read: I Understand

Topic: Talk About Customer Support Previous Topic   Next Topic Topic: Seeing what you want, and not liking it

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use