Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Simon Cozens
    @simoncozens
    LGTM. Thank you very much. I'll merge that, do another release, and we can go back to SILE...
    Caleb Maclennan
    @alerque
    I'm happy about getting back to SILE ;-)
    Simon Cozens
    @simoncozens
    Cassowary 2.2 out.
    Caleb Maclennan
    @alerque
    Um....something isn't right. I just tried to update the Arch Linux package for it and ended up with a blank cassowary.lua file.
    The source is there in the *.src.rock but Lua Rocks doesn't install it. It looks like that broke with my "fix" for luacheck — the modules path is somehow wrong in the spec now. We're doing something wrong with code layout in the repo because none of the tooling defaults work.
    Simon Cozens
    @simoncozens
    Did you have that problem with the 2.0-1 rock?
    Because the structure is the same...
    Hah, we're mentioned in a bug about this! luarocks/luarocks#425
    Try 2.2-1
    Caleb Maclennan
    @alerque
    image.png
    I like it when tests actually show the right answers, half the time with Lua & Travis I'm not even sure I'm testing what I think I'm testing.
    Olivier Nicole
    @OlivierNicole
    @alerque Thanks for your reply! I’ll try to make it work. I still find PEG grammars much less easy to manipulate than “usual” parser constructors.
    Simon Cozens
    @simoncozens
    @alerque, how do I stop caSILE being Turkish? (In particular with hyphenation.) I just caught it hyphenating "God's" to "God-s".
    Simon Cozens
    @simoncozens
    Oh. Language is English. Maybe that's a weird SILE bug...
    Caleb Maclennan
    @alerque
    Setting LANGUAGE = en in your make file should be correct, but it should also be the default now (it did start out with Turkish being the default).
    Perhaps you ran into a side effect of a mitigation for #355?
    I might have baked something in.
    Sure enough my apostrophe hack is hard coded in. Adding ah = after including the CaSILE make file to set the apostrophe hack to an empty string instead of the perl shell pipe it is now should do the trick.
    Caleb Maclennan
    @alerque
    I just wrapped that hack in a language flag check, so update to the latest master and it should go away.
    @simoncozens ^^^
    Simon Cozens
    @simoncozens
    Thanks!
    Olivier Nicole
    @OlivierNicole

    Hi,
    Still playing slowly with math rendering, I'm currently trying to use the different variants available for some glyphs (e.g. a bigger integral sign for some contexts). However, I don't really know how to do that yet. I see that @harrysummer's current code uses the Harfbuzz shaper, with a call that looks like SILE.shaper:shapeToken(self.text, self.options). The implementation of this function contains:

        local items = { hb._shape(text,
                          face.data,
                          face.index,
                          options.script,
                          options.direction,
                          options.language,
                          options.size,
                          options.features,
                          SILE.settings.get("harfbuzz.subshapers") or ""
                ) }

    I don't know how to tell this C call that I want to select some alternative glyph (whose ID I can get in the MATH OpenType table parsed by @harrysummer's code).

    Sorry this is a bit long, I guess my message is that I don't know how to feed alternative glyph info into the shaper calls, which are currently magic black boxes to me.

    Olivier Nicole
    @OlivierNicole
    I'm starting to understand that the shaper simply returns the list of glyph IDs.
    Olivier Nicole
    @OlivierNicole
    Hello again,
    I have managed to get the ID of the alternative glyph for some operator. However, I don't know how to get its dimensions. Is there a simple function in SILE to retrieve the dimensions of a glyph in the font?
    Caleb Maclennan
    @alerque
    I'm not positive off the top of my head but the answer is probably yes, have a look in the shaper class. If the answer is no then there needs to be one...
    Olivier Nicole
    @OlivierNicole
    I didn't find one in core/harfbuzz-shaper.lua which is the shaper used by the math code. I would make one, I just need to find out how…
    e.g. not sure if it can be done through calls to Harfbuzz, or not.
    Ah, some interesting things in src/fontmetrics.c.
    Olivier Nicole
    @OlivierNicole
    Ok I think it won't be too difficult to add a C function to get a glyph's dimensions.
    Olivier Nicole
    @OlivierNicole
    Mm, looks like Harfbuzz isn't the right library to get that.
    Olivier Nicole
    @OlivierNicole

    Well hello https://lists.freedesktop.org/archives/harfbuzz/2017-May/005936.html

    3 I suppose if I have (1) above I can get a hb_glyph_extents_t for each
    glyph. I am not sure how to convert it to a value that makes sense to
    LuaTeX which requires a width, depth and height.

    Right. Simon Cozens also wanted this for Sile...

    Olivier Nicole
    @OlivierNicole
    Alright, the C function sems to work.
    Simon Cozens
    @simoncozens
    What about SILE.shaper:measureChar(c) ?
    Olivier Nicole
    @OlivierNicole
    I saw it was implemented in a way that wouldn't work for me. First, it uses SILE.font.loadDefaults({}), the meaning of which I don't know but which will probably not use the math font. And second, it takes a character as an argument and uses Harfbuzz to shape it and get the dimensions, whereas I specifically need an alternative glyph that Harfbuzz won't know about, so I need to do my query directly on the glyph ID.
    Caleb Maclennan
    @alerque
    @OlivierNicole Why would harfbuzz not know about an alternative glyph? And why wouldn't it use the math font?
    Olivier Nicole
    @OlivierNicole

    Why would harfbuzz not know about an alternative glyph?

    Because math typesetting is not in the scope of Harfbuzz, so it wouldn't know that in display style, a bigger integral glyph should be used. It doesn't even have the notion of “display style”.

    And why wouldn't it use the math font?

    Well, in the first instruction of the function measureChar :

      measureChar = function (self, char)
        local options = SILE.font.loadDefaults({})
        local i = self:shapeToken(char, options)
        return { height = i[1].height, width = i[1].width }
      end,

    loadDefaults loads the font set by the font.family setting, whereas for math a math font should be used (I added a setting math.font.family for that).

    Olivier Nicole
    @OlivierNicole

    Why would harfbuzz not know about an alternative glyph?

    What I mean is when I ask Harfbuzz to shape the character “∫”, it will always use the same glyph, regardless of the math typesetting context, and that is not what I need.

    Simon Cozens
    @simoncozens
    What's going on with the lua lint checks on github? Seems like they're being a bit aggressive to unrelated PRs.
    Caleb Maclennan
    @alerque
    Aggressive in what sense? They aren't required yet, but yes they run on everything (as all CI checks should). It isn't a matter of being related or not. And they are failing until we get everything they have turned up fixed (after which I planned to make them required).
    Simon Cozens
    @simoncozens
    Sorry, I misunderstood what was going on. I saw them fail and I couldn’t merge a PR, but it wasn’t because of that; it was because other tests hadn’t come in yet.
    Caleb Maclennan
    @alerque
    The coveralls run on Travis takes forever and a day. That's usually the reason PR workflow is so slow.
    But ya at least for now the red marks on the overall status don't count for anything, only green on Travis is a blocker.
    If you have time to migrate the Azure job to the new repo address that would be great by the way.
    Simon Cozens
    @simoncozens
    Have been trying but need to find my Microsoft credentials!
    Caleb Maclennan
    @alerque
    Can't help you there ;-) I mean there are these things called password managers, but if you don't use one — good luck.
    Simon Cozens
    @simoncozens
    I have one, but for some reason it doesn’t seem to know either..:
    Caleb Maclennan
    @alerque
    Some days I love Lua. Not every day.
    Caleb Maclennan
    @alerque
    2019-11-05_23-05.png
    You know ... just that thing that happens when you break the entire length math system and only manage to fix it for one axis.
    Simon Cozens
    @simoncozens
    Pretty though.