Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposing the numeric space (aka. figure space) unit. #1705

Open
Omikhleia opened this issue Feb 2, 2023 · 3 comments
Open

Proposing the numeric space (aka. figure space) unit. #1705

Omikhleia opened this issue Feb 2, 2023 · 3 comments
Labels
enhancement Software improvement or feature request question Ask for advice or investigate solutions
Milestone

Comments

@Omikhleia
Copy link
Member

I am using the following unit here and there e.g. when it comes to ensuring there's enough space for numeric digits.

-- numeric space a.k.a. figure space
local numsp = SU.utf8charfromcodepoint("U+2007")
units["nspc"] = {
  relative = true,
  definition = function (value)
    local measureable, numspc = pcall(SILE.shaper.measureChar, SILE.shaper, numsp)
    if not measureable then
      SU.warn("Current font cannot measure the U+2007 space, falling back to measuring '0'")
      return value * SILE.shaper:measureChar("0").width
    end
    return value * numspc.width
  end
}

E.g. "3nspc" has the width of 3 numeric digits (regular 'figure' number).

Do you think it would make sense to have it in SILE's default units?

@alerque
Copy link
Member

alerque commented Mar 23, 2023

Yes I do, but I would call it "figure space" in line with the Unicode being referenced rather than "numeric space". I have a couple implementations of checking figure space sises.

The only other thing I might look into is whether any fonts do/may have different size figure spaces for +onum vs. +lnum (lining vs. old-stlye numbers).

@alerque alerque added the enhancement Software improvement or feature request label Mar 23, 2023
@alerque alerque added this to the v0.14.9 milestone Mar 23, 2023
@Omikhleia
Copy link
Member Author

The only other thing I might look into is whether any fonts do/may have different size figure spaces for +onum vs. +lnum (lining vs. old-stlye numbers).

It turns out I am struggling with these two. (I recently used EB Garamond, which defaults to onum , but has tnum and lnum... Doh, I need to understand some font-related things deeper).

@Omikhleia
Copy link
Member Author

I'm removing the 0.14.9 milestone here. This was a suggestion/question but there's no urge or absolute necessity for it.

@Omikhleia Omikhleia removed this from the v0.14.9 milestone Apr 7, 2023
@Omikhleia Omikhleia added the question Ask for advice or investigate solutions label Apr 7, 2023
@alerque alerque added this to the v0.x.y milestone Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Software improvement or feature request question Ask for advice or investigate solutions
Projects
None yet
Development

No branches or pull requests

2 participants