Pango for iPhone

I'm trying to compile Pango for iPhone. I've already patched it to
work with  CoreText instead of ATSUI. But there's still one more thing
that needs to be taken care of i.e. Cocoa Framework. iPhone doesn't
have Cocoa framework as such but what it does have is Foundation
framework which offers many classes as Cocoa framework. After shifting
from Cocoa to Foundation framework there are essentially only two
places where Pango still needs to be patched:

1) In function 'pango_atsui_family_list_faces' in
'pangoatsui-fontmap.c', line # 173 & 174

NSFontManager *manager = [NSFontManager sharedFontManager];
NSArray *members = [manager availableMembersOfFontFamily:[NSString

Now, Foundation framework doesn't have NSFontManager


Instead, there's UIFont


I'm kind of stuck here as you can see (links above) although we can
get fonts' names for a given family as required yet it's not evident
how will we get the weights or traits of fonts to come up with
equivalent method for 'availableMembersOfFontFamily'? Is that even
required or we can set some standard values? Can we somehow make pango
to get requied font with traits and weights from UIFont directly
instead first getting the list of available fonts and then choosing
from them (as UIFonts supports this)?

2) Masks... yes e.g. 'NSFixedPitchFontMask' as required by Pango are
also declared in Cocoa. We can however, declare them ourselves like

enum {
   NSItalicFontMask = 0x00000001,
   NSBoldFontMask = 0x00000002,
   NSUnboldFontMask = 0x00000004,
   NSNonStandardCharacterSetFontMask = 0x00000008,
   NSNarrowFontMask = 0x00000010,
   NSExpandedFontMask = 0x00000020,
   NSCondensedFontMask = 0x00000040,
   NSSmallCapsFontMask = 0x00000080,
   NSPosterFontMask = 0x00000100,
   NSCompressedFontMask = 0x00000200,
   NSFixedPitchFontMask = 0x00000400,
   NSUnitalicFontMask = 0x01000000

Will this work? It sure will compile...

Any thoughts, pointers, suggestions, help on these two issues will be
greatly appreciated..


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]