[BUG?] TTFontReader...

Karl Ramberg karl.ramberg at chello.se
Sat Oct 14 21:39:49 UTC 2000



Bob Arning wrote:
> 
> On Sun, 15 Oct 2000 00:10:36 -2100 Alexander Lesnevsky <lesnevsk at pol.ru> wrote:
> >   ((TTFontReader readFrom:...Arial.ttf) at:203) display
> >   203 is ASCII value of Russian "A", but you will see not "A", but
> >   "A" with smth above it - maybe from Czech or other language. Well,
> >   I used the utility to convert exactly this font to Strike font, and
> >   I use Cyrillic symbols normally. As I suppose, that nobody uses
> >   Cyrillic fonts, I've attached one.
> >   So, why ?
> 
> Alexander,
> 
> There are a couple of reasons you are not seeing what you want -
> 
> 1. There are two character-to-glyph mappings in the font you sent, one for the Mac and one for Windows. Squeak uses the Mac mapping if it exists as noted below:
> 
> processCharacterMappingTable: entry
> ....
>                         (pID = 1 and: [cmap notNil]) "Prefer Macintosh encoding over everything else"
>                                 ifTrue: [^ pID -> cmap].
> ...
> 
> 2. Even if you change this to use the Windows mapping, there are more than 256 glyphs supplied in that mapping (and the first 256 do not look particularly Cyrillic) and Squeak only uses the first 256. See
> 
> decodeCmapFmtTable: entry
> ...
>                 cmap _ Array new: 256 withAll: 0. "could be larger, but Squeak can't handle that"
>                 segments withIndexDo:
>                         [:seg :si |
>                         seg first to: seg second do:
>                                 [:i |
>                                 i < 256 ifTrue:
> ...
> 
> To get the glyphs, you would need to process beyond the first 256 and place the ones you want in the appropriate spots in the cmap.
> 
> Cheers,
> Bob

A japanese Squeaker implemented something that could handle more glyphs,
but I can't remember 
who. Look in the mail archives and on the swiki.

Karl





More information about the Squeak-dev mailing list