Comments (25)
@justvanrossum I just made this https://github.com/anthrotype/unicode-segmentation-py
(i just wanted an excuse to play with rust, really)
from fontgoggles.
VertAxis.romn tag in BASE table?
from fontgoggles.
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.
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.
from fontgoggles.
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.
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.
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.
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.
Windows application use vert
and not vrt2
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.
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.
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.
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.
Another relevant reference:
We should do grapheme clustering. Possibly with:
...although that package had its latest release in 2015.
from fontgoggles.
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.
or we would wrap this unicode-segmentation rust library from python
https://github.com/unicode-rs/unicode-segmentation
from fontgoggles.
Cool!
I just found there's another option on PyPI, that seems to be more actively maintained than uniseg:
from fontgoggles.
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.
If you are really lazy you can simply align +0.38em to the vertical center line, or make it user configurable.
from fontgoggles.
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.
VertAxis.romn tag in BASE table?
Time for me to learn about the BASE table, thanks!
from fontgoggles.
More todo:
- expose
hb_ot_layout_get_baseline
inuharfbuzz
(https://harfbuzz.github.io/harfbuzz-hb-ot-layout.html#hb-ot-layout-get-baseline). - or instantiate BASE on the fly with fonttools.
I hope people understand this really isn't a trivial feature request...
from fontgoggles.
Sure it isn’t. It is the equivalent of BiDi for vertical text.
from fontgoggles.
If the viewer supports BASE version 1.1 Variation Store table, that will be great.
from fontgoggles.
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)
- System requirements are not up to date HOT 3
- Need to upgrade to Python 3.10 HOT 3
- Show COLR layers in the glyph list
- No automatic mark feature when viewing designspace files HOT 8
- Show baseline / ascender / descender HOT 2
- Add support for selecting CPAL palette
- Ability to copy selection / specific cells from table HOT 1
- native support for arm64 architecture for M1 chip? HOT 3
- Add support for light mode / dark mode CPAL palette switching
- Add support for labeled CPAL palettes HOT 1
- Individual variable sliders per font
- FG listening to changes in the .gggls file
- allow to select skia as blackrenderer backend HOT 2
- Drop FreeType in favor of the HarfBuzz draw API, but using C, not Python pens HOT 17
- Some glyphs fails to render in COLRv1 variable font which renders fine in Chrome HOT 9
- Problem with certain COLRv1 glyphs in Noto-COLRv1.ttf HOT 14
- Export as SVG, PDF, Print HOT 2
- Zoom reset keyboard shortcut
- Feature request: Duplicate open file from within FontGoggles HOT 1
- Feature request: paragraph text view with line-breaking HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontgoggles.