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

Align font requirements with HTML (plain and Word) and PDF expectations #383

Closed
ronaldtse opened this issue Nov 30, 2020 · 17 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

Each Metanorma flavor + output format has a specific set of fonts to be used.

In HTML/browsers, the fonts specified need to use a browser understandable name for font-face and font-family.

In CSS 4, these two messages indicate:
w3c/csswg-drafts#3177 (comment)
w3c/csswg-drafts#3177 (comment)

That for HTML CSS fonts we should only use "full font name" (i.e. without style) and "postscript name"

And in Chrome:
https://stackoverflow.com/questions/24849224/css-font-family-which-name-does-css-font-use

So say for "Overpass" (https://github.com/fontist/formulas/blob/master/Formulas/overpass.yml)

- name: Overpass
  styles:
  - family_name: Overpass
    type: Bold Italic
    full_name: Overpass Bold Italic
    post_script_name: Overpass-BoldItalic

The HTML CSS font name is "Overpass" (family name) or the postscript name "Overpass-BoldItalic"

@ronaldtse ronaldtse added the enhancement New feature or request label Nov 30, 2020
@ronaldtse
Copy link
Contributor Author

@Intelligent2013 could you also help verify the font names needed for mn2pdf so @CAMOBAP can help align them here? Thanks!

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Nov 30, 2020

@ronaldtse to be on the same page where should we list those postscript font names? in fonts_manifest.yaml?

@ronaldtse
Copy link
Contributor Author

I think Fontist only accepts the family name right now? (Ping @alexeymorozov)

I wonder in the future we could use fontist as a dependency where you can get the appropriate names of fonts in order to pass the names to the output formats.

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Nov 30, 2020

The font names needed for mn2pdf:

bipm:

  • Arial
  • Times New Roman
  • Work Sans
  • STIX Two Math
  • Source Han Sans
  • TeXGyreChorus

csa:

  • Azo Sans
  • Azo Sans Lt
  • STIX Two Math
  • Source Code Pro

cc:

  • Source Sans Pro
  • STIX Two Math
  • Source Han Sans
  • Source Code Pro

gb:

  • SimSun
  • SimHei
  • Cambria
  • Cambria Math
  • Courier

iec:

  • Arial
  • Times New Roman
  • STIX Two Math
  • Source Han Sans
  • Courier

iho:

  • Helvetica Neue Arial
  • Cambria Math
  • SF Mono Fira Code
  • Courier
  • STIX Two Math

iso:

  • Cambria
  • Cambria Math
  • Times New Roman
  • Source Han Sans
  • Courier

itu:

  • Times New Roman
  • STIX Two Math
  • Arial
  • Courier

m3d:

  • Garamond
  • Arial
  • Cambria Math
  • Courier

mpfd:

  • Arial
  • STIX Two Math

nist:

  • Times New Roman
  • STIX Two Math
  • Calibri
  • Arial
  • Courier

ogc:

  • Lato
  • Arial
  • STIX Two Math
  • Source Han Sans
  • Fira Code
  • Courier

rsd:

  • Source Sans Pro
  • STIX Two Math
  • Source Serif Pro
  • Source Code Pro

un:

  • Times New Roman
  • STIX Two Math
  • Source Han Sans
  • Arial
  • Arial Black
  • Courier

Note: Source Han Sans font in most cases needs for char replacement when old windows font version is using. For example, in old windows Times New Roman font there aren't some white-spaces glyphs, and if we don't specify 'Source Han Sans' font, then we see '#' char in PDF.

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Nov 30, 2020

@ronaldtse those fonts above should be added to fonts_manifest.yaml too, right?

@ronaldtse
Copy link
Contributor Author

@CAMOBAP yes, that's correct.

@ronaldtse
Copy link
Contributor Author

We have some problems with the fonts here:

  • For iho, we can't use "SF Mono" because it has a font license that does not allow general usage.
  • We can't find a freely licensed Helvetica Neue.

@Intelligent2013 anything we can change here?

@ronaldtse
Copy link
Contributor Author

@Intelligent2013 actually I don't see where IHO uses SF Mono or Helvetica Neue. Let's change to Fira Code and Neue Haas Grotesk instead.

In addition, Azo Sans is available on macOS by default, but not freely licensed. We will have to find an alternative.

@Intelligent2013
Copy link
Contributor

@Intelligent2013 actually I don't see where IHO uses SF Mono or Helvetica Neue. Let's change to Fira Code and Neue Haas Grotesk instead.

@ronaldtse ok.
FYI, IHO xslt was developed for source doc templates in gh-pages branch (for example, https://raw.githubusercontent.com/metanorma/mn-samples-iho/gh-pages/documents/b12.doc). The main font in docs is "Helvetica Neue":

p.MsoNormal, li.MsoNormal, div.MsoNormal {
  mso-style-unhide: no;
  mso-style-qformat: yes;
  mso-style-parent: "";
  margin: 0cm;
  margin-bottom: 12.0pt;
  mso-pagination: widow-orphan;
  font-size: 12.0pt;
  font-family: "Helvetica Neue",Arial,sans-serif;
  mso-fareast-font-family: "Times New Roman";
  mso-ansi-language: EN-US;
  mso-fareast-language: EN-US; }

For source code:

p.Sourcecode, li.Sourcecode, div.Sourcecode, pre.Sourcecode, pre {
  mso-style-unhide: no;
  mso-style-qformat: yes;
  mso-style-parent: "";
  margin-top: 6.0pt;
  margin-right: 0cm;
  margin-bottom: 6.0pt;
  margin-left: 0cm;
  text-align: left;
  mso-pagination: widow-orphan;
  tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
  font-size: 10.0pt;
  font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  mso-fareast-font-family: Calibri;
  mso-bidi-font-family: "Courier New";
  mso-ansi-language: EN-GB; }

In case if font didn't install on system, then MS Word uses next first available font. In this case - Arial:
изображение

@Intelligent2013
Copy link
Contributor

@CAMOBAP font list above was modified for iho.

@Intelligent2013
Copy link
Contributor

@CAMOBAP

Font list for bipm updated - added TeXGyreChorus font:

bipm:

  • Arial
  • Times New Roman
  • Work Sans
  • STIX Two Math
  • Source Han Sans
  • TeXGyreChorus

@CAMOBAP CAMOBAP added this to To do in Alexander Bobrikovich via automation Dec 10, 2020
CAMOBAP added a commit to metanorma/metanorma-bipm that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-csa that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-csa that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-cc that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-gb that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-iec that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-iho that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-iso that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-mpfa that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-ogc that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-ribose that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-un that referenced this issue Dec 11, 2020
CAMOBAP added a commit to metanorma/metanorma-un that referenced this issue Dec 11, 2020
@CAMOBAP
Copy link
Contributor

CAMOBAP commented Dec 11, 2020

PRs ready for review

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Dec 11, 2020

The issue for missing fonts reported fontist/fontist#188

@ronaldtse
Copy link
Contributor Author

@CAMOBAP so this is now ready to go?

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Dec 12, 2020

@ronaldtse yep I think os

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Jul 23, 2021

Done

@CAMOBAP CAMOBAP closed this as completed Jul 23, 2021
Alexander Bobrikovich automation moved this from Medium priority to Done Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants