chfoo / cobbletext Goto Github PK
View Code? Open in Web Editor NEWComplex text layout and rendering engine library
License: Mozilla Public License 2.0
Complex text layout and rendering engine library
License: Mozilla Public License 2.0
Hi there,
there seems to be a bug when shaping text runs. The shaper assumes that a run was successfully shaped when harfbuzz returns a minimum amount of valid glyphs (see here). For certain texts, this is valid logic. However there are situations where this fails. Take for example the following text (font used is Segoe UI Emoji):
๐
๐๐
(as C-string: "๐\r\n๐๐")
This results in Adobe NotDef being used for all runs. I suppose this is because the LayoutEngine splits up the text before shaping it (see here). It fails to apply line breaks to the text, which results in a single run. When harfbuzz shapes this run, it outputs the following code points:
[0] 11680
[1] 1
[2] 0
[3] 11680
[4] 11680
Because 4 out of 5 glyphs are valid, the "notDef" threshold becomes 4/5=0.2
. This is lower than the acceptable threshold, thus Adobe NotDef is used for the entire run. This example can be verified using the Cobbletext online example:
Is this a known issue? I assume the bug stems from LayoutEngine's failure to properly break the text into multiple runs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.