Giter VIP home page Giter VIP logo

sheenfigure's Issues

Limit the buffer size and execution time

To prevent attacks, impose an upper limit on buffer size and execution time when shaping text. For example, increment a counter on the number of executed OpenType lookups and give up when it gets excessive, and make sure that the rendering buffer does not get excessively large; check out how HarfBuzz does this. See test case GSUB-3.

Default script selection

The current implementation only selects the provided script tag, but the OpenType specification defines a fallback mechanism. The relevant paragraph from Common Table Formats is following.
An application should use a DFLT script table if there is not a script table associated with the specific script of the text being formatted, or if the text does not have a specific script (for example, it contains only symbols or punctuation).

Invalid code unit to glyph map for backward text mode

The code unit to glyph map is correctly produced for forward text mode. In case of backward text mode, it remains correct for 1-1 mapping. But if there are ligatures or multiple substitutions, it becomes invalid.

Motivation

Hi,

I'm curious. What's the motivation for writing this library? Why couldn't you use HarfBuzz?

Retreiving caret edges from SFAlbum

Even though SFAlbum provides mapping from code unit to glyph index, caret positions need to be calculated manually. The process is very complex as the caret should not stop at some code units such as surrogates, or the caret adjustments should be identified in cases of character/glyph clusters. There can be ligatures whose effective caret positions should be obtained from Ligature Caret List Table.

Since caret handling is very fundamental need of text editing, having it implemented in SFAlbum would be very helpful. The logic can be borrowed from loadCharExtents method in Tehreer-Android project.

Remove unicode general category lookup

The support for getting the general category of a code point has been added in SheenBidi. It would be a good idea to use that method instead of duplicating the lookup feature here in SheenFigure as well.

Revise font class for variable fonts

In order to support variable fonts, some adjustments are required in the font class. As variable fonts can substitute the features, it is not possible to select a variable instance in the artist. There should perhaps be a function to create a variable instance of the font from the default one.

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.