tangram-es
tangram-es copied to clipboard
Can render text use CoreText replace Harbuzz freetype In iOS?
I am using tangram-es to draw map in my app, both In Android & iOS, I found the tangram framework make iOS ipa size up 3500kb, the text engine rely on Harbuzz freetype icu,so if I can replace this part to use coretext in iOS,that will reduce the ipa size, I don't determine if it is feasible。Need some advice。thanks a lot。
Using CoreText instead of Harfbuzz on iOS is an appealing idea, I've definitely considered it in the past. However the text layout and rendering backend in Tangram ES is not simple - integrating CoreText would be a large amount of work. I'm also not sure exactly how to implement some parts of our renderer (like rendering individual grapheme clusters as signed distance fields) using CoreText.
We do part of coretext in alfons: https://github.com/hjanetzek/alfons/pull/14
Ok actually now that I've thought about this a bit longer, it might be reasonable to completely drop Harfbuzz, Freetype, and ICU on iOS and use CoreText/CoreGraphics for font layout and rendering instead. This would require some architectural changes to alfons - some functionality that is currently implemented in Tangram ES would probably need to be moved into alfons, or at least moved behind an abstraction of some kind.
This would be a major undertaking, and might introduce some differences in text/font behavior in Tangram ES between Android and iOS. But it would substantially reduce our binary size on iOS and might lead to improved performance and better handling of certain features (like font matching). I'm going to make a plan to try implementing this.
Ok actually now that I've thought about this a bit longer, it might be reasonable to completely drop Harfbuzz, Freetype, and ICU on iOS and use CoreText/CoreGraphics for font layout and rendering instead. This would require some architectural changes to alfons - some functionality that is currently implemented in Tangram ES would probably need to be moved into alfons, or at least moved behind an abstraction of some kind.
This would be a major undertaking, and might introduce some differences in text/font behavior in Tangram ES between Android and iOS. But it would substantially reduce our binary size on iOS and might lead to improved performance and better handling of certain features (like font matching). I'm going to make a plan to try implementing this.
so exciting about this~