bug of ZFont on iOS

bug of ZFont on iOS
0.0 0


I got 2 problems with custom ttf fonts on iOS.

1. specifing absolute path of a “.ttf” file does not take effect.
this can be fixed easily by modifying FontManager.m

- (BOOL)loadFont:(NSString *)filename {
  NSString *fontPath;
  NSRange range = [filename rangeOfString:@"/"] ;
  if( range.location != 0 ) {
    fontPath = [[NSBundle mainBundle] pathForResource:filename ofType:@"ttf"];
  } else {
    fontPath = filename;
  //NSString *fontPath = [[NSBundle mainBundle] pathForResource:filename ofType:@"ttf"];

2. chinese characters are displayed as rectangles
I’m not familiar with how TTF is rendering, is there a fix for it?


sorry, my ttf font doesn’t contains chinese characters, so the 2nd issue is not a problem.


About issue one, you can refer FontTest.


Would you use system default font instead of rectangle when characters are not contained in custom .ttf ?