Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:06
    behdad synchronize #2728
  • 17:06

    behdad on instancer-l4

    [instancer] Add assert (compare)

  • 16:47
    behdad synchronize #2728
  • 16:47

    behdad on instancer-l4

    [instancer.solver] Return None … (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-01

    (compare)

  • 16:10
    pyup-bot closed #2721
  • 16:10
    pyup-bot commented #2721
  • 16:10
    pyup-bot opened #2731
  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    Update uharfbuzz from 0.26.0 to… (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    Update scipy from 1.8.1 to 1.9.0 (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    Update scipy from 1.7.3 to 1.9.0 (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    Update reportlab from 3.6.10 to… (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    Update sphinx from 5.0.1 to 5.1… (compare)

  • 16:10

    anthrotype on pyup-scheduled-update-2022-08-08

    (compare)

  • 15:44
    behdad synchronize #2728
  • 15:44

    behdad on instancer-l4

    [instancer.solver] More test (compare)

  • 15:41
    behdad synchronize #2728
  • 15:41

    behdad on instancer-l4

    [instancer.solver] More test (compare)

  • 15:35
    behdad synchronize #2728
  • 15:35

    behdad on instancer-l4

    [instancer.solver] More fixes (compare)

一丝
@yisibl
image.png
n8willis
@n8willis
I've been trying to add a Subsetter() to some code and it's raising a weird TypeError that I can't figure out the reason for....
specifically, it's in unicodes_missing, where it tries to log a missing unicode val, it's tripping up with TypeError: %X format: an integer is required, not str
I'm populating the Subsetter with a unicodes=[] list. That seems like pretty basic stuff, so I'm obviously not seeing what's wrong for some simple. Any clearer eyes out there?
n8willis
@n8willis
(Anyway, for anybody who stumbles across this late at night, the origin of the approach I used was this SO question, specifically mark2mark's answer: https://stackoverflow.com/questions/55009981/how-to-use-pyftsubset-of-fonttools-inside-of-the-python-environment-not-from-th )
passing a list of glyphs works as expected, but it seems like something different is necessary for the populate to get unicodes
anthrotype
@anthrotype:matrix.org
[m]
unicodes parameter wants a list of integers
instead of passing subset.populate(unicodes=["U+0041", "U+0042", ...]), you should pass instead the decimal integer value for those hexadecimal unicode codepoints
just strip the leading "U+" and pass the rest to int(..., 16)
hexadecimal is base 16 ;)
Cosimo Lupo
@anthrotype
something like subset.populate(unicodes=[int(u.lstrip("U+", 16) for u in ["U+0041", "U+0042", ...]])
n8willis
@n8willis
OK
should parse_unicodes() produce the right format?
because I also tried passing the ranges of interest through that & got the same error.
although those could be two separate issues
David Corbett
@dscorbett
How should I set sTypoAscender and sTypoDescender in a 1000-unit-per-em font such that ascenders of around 1000 units and descenders of around 1250 units do not overlap adjacent lines in HTML with the CSS declaration line-height: 1? The seemingly obvious solution of setting them to 1000 and -1250 does not work: the lines still overlap and the first line is too high within the containing box.
madigens
@madigens:matrix.org
[m]
my feeling is that the answer depends on the browser 😬
also remember the usetypometrics flag somewhere (head?)
accia
@ACCia
Why, use fontbuilder_ test.py test example generates font file, which is not a valid font in windows
n8willis
@n8willis
What's the fastest way to clip TTGlyphs? Like, just slice off everything above some Y val, and still have closed contours?
I'm looking at booleanOperations and skia-pathops, but most of the example code I find is from people working on defcon or glyphs-source objects, not operating directly on TTGlyphs...
madigens
@madigens:matrix.org
[m]
no idea but i think you can run bOps ops on ttglphs and if not, draw them into ufolib2 glyphs and bOps on that
anthrotype
@anthrotype:matrix.org
[m]
fontTools.ttLib.removeOverlaps
you can even call it as a script
From the console
fonttools ttLib.removeOverlaps --help
requires skia-pathops
n8willis
@n8willis
ok, so skPathFromGlyph looks doable ...
without roundtripping through glyphs, certainly
anthrotype
@anthrotype:matrix.org
[m]
you create a pathops.Path from a TTGlyph, then call intersection then convert back to TTGlyph, replacing original
You want to call the pathops.op() method with two Paths and PathOp.INTERSECTION operator
n8willis
@n8willis
yeah. I'll give it a try
thanks @anthrotype:matrix.org !
Nuc1eoN
@Nuc1eoN_gitlab
Any bitmap font or text art glyph enthusiasts here? :P
Fredrick Brennan
@ctrlcctrlv:matrix.org
[m]
@Nuc1eoN_gitlab: it seems today the answer is oui unified-font-object/ufo-spec#205
Nuc1eoN
@Nuc1eoN_gitlab
Sounds nice. If anybody is interested in bitmap fonts, ascii art and the like, we have a group over at #retrofonts.club @ irc.libera.chat
n8willis
@n8willis
Is there any FOSS code out there for deriving skeletons from TTGlyphs? Or, alternatively, mitred offset curves?
Akin to the general-geometry stuff here: https://www.sthu.org/research/straightskeleton/ (which has an implementation, but is not open source)
I've also seen the GlyphsApp LTTR-INK plugin, which is similarly not open; just wondering if I've overlooked something.
madigens
@madigens:matrix.org
[m]
not aware, but maybe ask on font twitter?
n8willis
@n8willis
Just in case anybody has been losing sleep over this question waiting for some closure, the answer appears to be "No, there isn't."
David Corbett
@dscorbett
Is there anything that optimizes coverage tables by reassigning glyph IDs to minimize the number of necessary RangeRecords?
anthrotype
@anthrotype:matrix.org
[m]
Reordering glyphs in an existing font is not trivial, the only implementation that I know of is the one we made for nanoemoji tool here, it doesn't do it for optimizing coverage range records but you can use it as a start
(I'm on the runway waiting for my flight to depart)
David Corbett
@dscorbett
This is for a not-yet-built font: I know what the glyphs will be and all the GSUB and GPOS rules, but nothing has been compiled. Does that make it easier?
anthrotype
@anthrotype:matrix.org
[m]
Yes, in that case you simply need to set the glyphOrder of your source font to the desired list
And the compiler will use that order you gave