Use Opentype Font Features In Android
Solution 1:
As of api level 21, Paint now supports OpenType font features.
Solution 2:
Outdated, look at dcow's answer instead
I don't think Android provide such API but you may use WebView, specially the new KitKat Chrome WebView would be nice if is not supported on older WebView. A sample that you can see a opentype feature setting difference via preinstalled Droid Arabic Naskh font: <div style="-webkit-font-feature-settings: 'rlig' 0">لا</div>
Otherwise I guess you should dive into JNI compiling Harfbuzz/Freetype and may Cairo for rendering glyph outlines if there is not any other way for it. Have a look at some HarfBuzz examples, you may be able to port it to your Android application. Depends on what you need other than configuring opentype features (layout, line wrapping) you may require compiling ICU4C or Pango and other libraries, but that would be very large dependency just for a mobile app of-course.
Post a Comment for "Use Opentype Font Features In Android"