Giter Site home page Giter Site logo

Comments (25)

anthrotype avatar anthrotype commented on May 24, 2024 1

@justvanrossum I just made this https://github.com/anthrotype/unicode-segmentation-py

(i just wanted an excuse to play with rust, really)

from fontgoggles.

hatchzo avatar hatchzo commented on May 24, 2024 1

VertAxis.romn tag in BASE table?

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

If you activate the vrt2 feature, do the rotated latin characters appear?

It seems HarfBuzz does not turn on vrt2 by default for vertical layout.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

FontGoggles only supports the vrt2 way of rotating latin characters, and currently does not support the vert model, where the layout engine rotates the latin.

Maybe this is interesting regarding vrt2 and HarfBuzz, a post from the HarfBuzz mailing list that made HarfBuzz change the default for vrt2:
https://lists.freedesktop.org/archives/harfbuzz/2013-August/003490.html

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

image

from fontgoggles.

hatchzo avatar hatchzo commented on May 24, 2024

Thanks for your prompt response and I understand. Some CJK fonts (such as NotoCJK/Source Han Sans) don't support pre-rotated glyph outlines. This kind of fonts will not be exact latin posture on vertical regardless of vrt2 activation. I expect that fontgoggles supports vert mode glyph orientation.

from fontgoggles.

khaledhosny avatar khaledhosny commented on May 24, 2024

There would need to be an option to segment text based on Unicode Vertical Orientation property, and the sideways segments would be shaped horizontally then rotated.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

I see that TextEdit.app also only supports vrt2 rotation, and for now this is what FontGoggles will do, too.

Supporting vert-style rotation is going to be a big change, one that I cannot implement in the short term. I'll leave this issue open as an enhancement request.

from fontgoggles.

hatchzo avatar hatchzo commented on May 24, 2024

I feel that it is definitely import that fonts and apps should support UTR#50. This will more easier way to get the correct posture on vertical.

from fontgoggles.

be5invis avatar be5invis commented on May 24, 2024

Windows application use vert and not vrt2 🤷‍♀. They itemize the text, break the text into “sideways” runs (being upright in vertical mode) and “non-sideways” runs (being rotated in vertical mode), and apply vert to the “sideways” runs. In DWrite, the function is IDWriteTextAnalyzer1::AnalyzeVerticalGlyphOrientation.

This is somehow like how UAX50 should work, but the orientation rule may be different.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

I'm not saying it's not important, I'm saying that right now I don't have the capacity to implement this, as it's a non-trivial change.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

Also, since the solution involves segmentation, it's related to #35, which also requires a non-trivial solution. We'll get there, just not right now.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

Before this can be implemented, we need to be able to get at the Unicode "vertical orientation property".

Unless I'm missing something, I don't see this property being available in the builtin unicodedata module, nor in the 3rd party unicodedata2 module, nor in fontTools.unicode or fontTools.unicodedata.

Probably best to make a PR for fonttools that adds this, similar to the "script" property and others.

Here's the relevant Unicode data file:

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

Another relevant reference:

We should do grapheme clustering. Possibly with:

...although that package had its latest release in 2015.

from fontgoggles.

anthrotype avatar anthrotype commented on May 24, 2024

make a PR for fonttools that adds this, similar to the "script" property

👍

grapheme clustering

PyICU should have that https://github.com/ovalhub/pyicu

from fontgoggles.

anthrotype avatar anthrotype commented on May 24, 2024

or we would wrap this unicode-segmentation rust library from python

https://github.com/unicode-rs/unicode-segmentation

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

Cool!

I just found there's another option on PyPI, that seems to be more actively maintained than uniseg:

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

Btw. does anyone in this thread know where the rotated baseline should be for the rotated characters, relative to the vertical center line?

Perhaps the middle between ascender and descender, but that's just a rather uneducated guess.

from fontgoggles.

be5invis avatar be5invis commented on May 24, 2024

If you are really lazy you can simply align +0.38em to the vertical center line, or make it user configurable.

from fontgoggles.

be5invis avatar be5invis commented on May 24, 2024

Another way is to find some of the characters in Enclosed CJK Letters and Months like , and its vertical center is a good reference.

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

VertAxis.romn tag in BASE table?

Time for me to learn about the BASE table, thanks!

from fontgoggles.

justvanrossum avatar justvanrossum commented on May 24, 2024

More todo:

I hope people understand this really isn't a trivial feature request...

from fontgoggles.

khaledhosny avatar khaledhosny commented on May 24, 2024

Sure it isn’t. It is the equivalent of BiDi for vertical text.

from fontgoggles.

hatchzo avatar hatchzo commented on May 24, 2024

If the viewer supports BASE version 1.1 Variation Store table, that will be great.

from fontgoggles.

lianghai avatar lianghai commented on May 24, 2024

Btw. does anyone in this thread know where the rotated baseline should be for the rotated characters, relative to the vertical center line?

It’s a whole pile of hot mess, inconsistent heuristics across platforms. The BASE table is not reliable. FontGoggles will need to provide an offset slider for users, then a default value doesn’t need to be sophisticated.

from fontgoggles.

Related Issues (20)

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.