Ich habe es ehrlich versucht, aber noch nichts herausgefunden...
Z.B. habe ich so was ausprobiert:
NSLayoutManager* layoutManager = [[NSLayoutManager alloc] init];
NSTextStorage* textStorage = [[NSTextStorage alloc] initWithString:@"abc"];
[textStorage addLayoutManager:layoutManager];
NSRange stringRange=NSMakeRange(0,[@"abc" length]);
NSMutableData* glyphData=[NSMutableData dataWithLength:sizeof(CGGlyph)*stringRange.length+1];
CGGlyph* glyphs=(CGGlyph*)[glyphData mutableBytes];
unsigned char *bidiLevelBuffer = calloc([@"abc" length], sizeof(unsigned char));
int glyphCount = (int)[layoutManager getGlyphsInRange:stringRange glyphs:glyphs properties:NULL characterIndexes:NULL bidiLevels:bidiLevelBuffer];
NSLog(@"--- %i, \"%s\"", glyphCount, bidiLevelBuffer);
mit dem Ergebnis:
2021-12-29 10:39:54.694104+0300 aTypeTrainer4Mac[61412:3479843] --- 3, ""
also blieb bidiLevelBuffer leer...
...
any ideas?
Z.B. habe ich so was ausprobiert:
NSLayoutManager* layoutManager = [[NSLayoutManager alloc] init];
NSTextStorage* textStorage = [[NSTextStorage alloc] initWithString:@"abc"];
[textStorage addLayoutManager:layoutManager];
NSRange stringRange=NSMakeRange(0,[@"abc" length]);
NSMutableData* glyphData=[NSMutableData dataWithLength:sizeof(CGGlyph)*stringRange.length+1];
CGGlyph* glyphs=(CGGlyph*)[glyphData mutableBytes];
unsigned char *bidiLevelBuffer = calloc([@"abc" length], sizeof(unsigned char));
int glyphCount = (int)[layoutManager getGlyphsInRange:stringRange glyphs:glyphs properties:NULL characterIndexes:NULL bidiLevels:bidiLevelBuffer];
NSLog(@"--- %i, \"%s\"", glyphCount, bidiLevelBuffer);
mit dem Ergebnis:
2021-12-29 10:39:54.694104+0300 aTypeTrainer4Mac[61412:3479843] --- 3, ""
also blieb bidiLevelBuffer leer...
...
any ideas?
Gruss aus Russland
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Valentin V. ()