GithubHelp home page GithubHelp logo

chfoo / cobbletext Goto Github PK

View Code? Open in Web Editor NEW
40.0 3.0 2.0 343 KB

Complex text layout and rendering engine library

License: Mozilla Public License 2.0

CMake 10.78% C 9.44% C++ 42.91% Python 2.44% HTML 31.93% JavaScript 2.15% Shell 0.35%
text-rendering layout-engine bindings

cobbletext's People

Contributors

chfoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cobbletext's Issues

Bug in shaping logic

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:

image

Is this a known issue? I assume the bug stems from LayoutEngine's failure to properly break the text into multiple runs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.