-
Notifications
You must be signed in to change notification settings - Fork 2
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
Supporting additional fonts per-document #618
Comments
@opoudjis could you pass the value from |
I think this is an ad hoc solution to the problem of font coverage of scripts, but it's going to be a requirement inevitably. I'm going to shove the fonts values into Presentation XML as
|
These are metanorma processing options; so the attribute name shall be prefixed with |
@opoudjis we probably don't need to prefix |
I do not understand at all the distinction between font font names and font formula names that is being made by @ronaldtse and, more importantly, the https://github.com/fontist/fontist README doesn't. I'm therefore treating them the same. |
@opoudjis maybe only do the fonts. Ignore "font family". |
It was a brain fart on my part. |
Because I don't actually understand the confirmation options, please tell me whether this code does what is requested or not:
|
As far as I can tell, mn2pdf does not take a fonts parameter; metanorma gem ensures that the requested fonts are installed, but I have no idea if the foregoing is what is needed for mn2pdf to be aware of them. @CAMOBAP @Intelligent2013 please review |
@opoudjis no need to pass a new info about additional fonts as separated parameter. Just FYI, how Apache FOP (xsl-fo) works:
|
I think a font manifest should technically go into Presentation XML. Before the Presentational XML is rendered into other formats, Fontist can use the font manifest to ensure the fonts are installed. Right now, mn2pdf takes the font manifest file directly which already contains the full locations of the fonts. |
I have no idea what the desired format is, or how to generate it from a flavour. Someone is going to have to tell me, given that this is not documented in fontist. |
@opoudjis FYI, I've found some strange behavior.
:fonts: Euphemia
:font-license-agreement: agree-to-terms
:toclevels: 2 Resulted presentation xml contains <misc-container>
<presentation-metadata>
<name>TOC Heading Levels</name>
<value>2</value>
</presentation-metadata>
<presentation-metadata>
<name>font-license-agreement</name>
<value>agree-to-terms</value>
</presentation-metadata>
<presentation-metadata>
<name>fonts</name>
<value>Euphemia</value>
</presentation-metadata>
<presentation-metadata>
<name>TOC Heading Levels</name>
<value>2</value>
</presentation-metadata>
<presentation-metadata>
<name>TOC Heading Levels</name>
<value>2</value>
</presentation-metadata>
</misc-container>
:fonts: Euphemia
:font-license-agreement: agree-to-terms Resulted presentation xml doesn't contain <presentation-metadata>
<name>font-license-agreement</name>
<value>agree-to-terms</value>
</presentation-metadata>
<presentation-metadata>
<name>fonts</name>
<value>Euphemia</value>
</presentation-metadata> |
@opoudjis you can ignore my previous comment:
I've made patch in xslt already in metanorma/mn-native-pdf#361. |
As I've said, I don't know what I'm supposed to be doing here. If @ronaldtse and/or @Intelligent2013 you are happy with the implementation, please close the ticket; if not, please tell me what I need to do. |
For the record (cc: @ribose-jeffreylau ), I found out that "Noto Sans Canadian Aboriginal" provides Canadian Syllabics. This is probably better than using a font only free for personal use. This font is already available in Fontist: https://github.com/fontist/formulas/blob/v3/Formulas/google/noto_sans_canadian_aboriginal.yml |
Unassigning myself. If someone can identify something for me to do, they can reassign me. |
@CAMOBAP can you please help here? Thanks. |
Summarizing
@Intelligent2013 @opoudjis I'm a bit out of context about **also please check proposed plan |
Not so. The original semantic XML is converted by Metanorma into Presentation XML, which does things like resolve cross-references and i18n. All of PDF, DOC, HTML are generated from the Presentation XML. It is only semantics-specific formats, like STS, which are generated from the semantic XML. So any font directives are appropriate to insert in Presentation XML, not semantic XML. |
This issue is also happening here: |
Metanorma Asciidoctor is converted into Metanorma Semantic XML. Then, Metanorma Semantic XML is converted to Presentation XML : this includes internationalisation, resolving cross-references to printable content, and other such render-ready preprocessing. All of HTML, DOC, and PDF are generated from Presentation XML, rendering it with minimal duplication of preprocessing. Occasionally it turns out PDF needs access to the semantic original information, so the Semantic XML is embedded inside the Presentation XML. Inasmuch as I understand your plan, it looks fine to me :) Various rendering directives are passed on as metadata from Semantic XML through to Presentation XML, and the Semantic XML by definition does nothing with them; that includes choices of font. So the font is named in Metanorma Asciidoctor, but is not used until the Presentation XML is processed for PDF generation. |
Some documents, such as ISO 24229, required support of additional fonts not available in the normal ISO repertoire.
For example, a font for Canadian Syllabics is necessary for rendering those symbols in ISO 24229 (metanorma/mn-native-pdf#181).
The font is available in Fontist as https://github.com/fontist/formulas/blob/v3/Formulas/euphemia.yml (name: Euphemia, formula name: euphemia)
A mechanism for additional font usage can be implemented in Metanorma:
e.g.,
Then Metanorma will ask Fontist to install that font with the appropriate options, and pass the font information to mn2pdf.
This is possibly a global (cross-flavour) option rather than an ISO specific one.
The text was updated successfully, but these errors were encountered: