Low-level text engine for tablets

Reference Information. I develop software for viewing specialized academic content with complex layout requirements (complex footnotes, tables, images, custom character sets, etc.). In the desktop version, this is done using the low-level TextFormatter WPF and in the web application, it is run using Flash FTE (not the TLF, but the underlying engine). Both of them are low-level mechanisms that create text strings of a specified width and formatting, which can then be organized to form pages.

We would like to transfer the application to the iPad and Android tablet. At the moment, we are inclined to use AIR for Android / Packager for iPhone to reuse most of the existing as3 codebase. However, we want to explore the possibility of moving to each platform.

My question is: iOS and Android offer a comparable low-level text engine capable of:

  • Line break at different widths
  • Bidirectional text
  • Kerning, ligatures, etc.
  • Several built-in fonts
  • Inline and floating images
  • Select / Select Text
  • Everything you need to create complex layouts

Assuming this is not offered by the native APIs (and, at least from viewing the Android SDK, it seems to be so), are there any third-party structures for these platforms that do all of the above?

+3
1

iOS CoreText. ( C) , . . http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/CoreText_Programming/Introduction/Introduction.html


Apple , Adobe. , . ( PDF) CoreText , Adobe , . .

, .

  • ,
  • ,
  • ,
  • (, ),
  • ..

Framework CoreText iOS. , , . ( ). , , , .

CoreText . : (1) Core Text iOS (2) Core :

CoreText Mac OS X. iOS. CoreText Mac, , . , . Apple Mac.

Flash ( ), Apple. , . , Apple . ( - Adobe:)


, , . NSAttributedString ( ) , , , NSAttributedString CoreText.

, NSAttributedString, .

// In an UIView subclass.
- (void)drawRect:(CGRect)rect
{
    NSAttributedString* AS  =   [self text]; // Assumes this property exist.
    CGContextRef        CTX =   UIGraphicsGetCurrentContext();
    CGMutablePathRef    P   =   CGPathCreateMutable();
    CGRect              R   =   rect;
    CGPathAddRect(P, NULL, R);

    CTFramesetterRef    FS  =   CTFramesetterCreateWithAttributedString((CFAttributedStringRef)AS);
    CTFrameRef          F   =   CTFramesetterCreateFrame(FS, CFRangeMake(0, 0), P, NULL);

    CTFrameDraw(F, CTX);

    CFRelease(FS);      
    CGPathRelease(P);

, , -.

    [[self layer] setGeometryFlipped:YES];

/, .

  • HTML + CSS
  • freetype

HTML UIWebView . CSS3 . , . HTML UIWebView , CoreText. CoreText UITableViewCell - .

freetype library - . ​​ . , . .


Android.

+2

Source: https://habr.com/ru/post/1794434/


All Articles