Code Monkey home page Code Monkey logo

monoback's People

Contributors

asvel 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

Watchers

 avatar

monoback's Issues

OpenType/CFF font is not supported.

The glyph outlines in an OpenType font may be defined in two formats, TrueType or Compact Font Format (CFF), the latter is not supported by this tool, there are two major reasons:

  • Render engines ignore OpenType hmtx table (Horizontal Metrics Table, which specified glyph width and side bearing) for CFF outlines font, because CFF data also contains relevant values and takes higher priority.
    • It can be fixed through changing the defaultWidthX values inside CFF data and hardcoding side bearing into glyphs.
    • CFF2 format does not have this problem as it only contains glyph data.
  • Render engines cannot be tuned to "monospace mode" with CFF outlines font in any way, OS/2.panose.bProportion is ignored, post.isFixedPitch has no effect, even hdmx feature won't help.
    • "monospace mode" is needed to align CJK characters with Latin characters correctly, for example, if a monospaced font is 0.6:1 ratio and displayed at 14px, render engine will render it at width 14*0.6=8.4 round to 8px, and render the aligned CJK characters at width 14*1.2=16.8 round to 17px, alignment will be broken without additional adjustment.
    • Some render engines always enable this adjustment but others are not, they only enable it for fonts with matched property.

Furthermore, I could not find any CFF outlines font aligned correctly under every environment, for a test case, neither Source Han Mono nor Source Han Code JP aligned correctly in WebStorm 2022.2.1(#WS-222.3739.57) under Windows 10 21H2(19044.1889).

PS: If you are trying to fallback to Source Han Sans, there are several third-party TrueType outlines editions such as Source-Han-TrueType and source-han-sans-ttf.

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.