Closed mcanouil closed 2 years ago
Hi @mcanouil - can you please reopen this with only the .lua changes?
Sorry for the delay, GitHub didn't add me as a repo watcher so I missed these :(
@cscheid This would also remove the examples added to highlight lua's changes. I can just rebase/merge to include the PR you merged.
That works too.
@cscheid no more conflicts in the PR. By the way do you have an opinion on this https://github.com/quarto-ext/fontawesome/issues/8#issuecomment-1192845950) regarding accessibility?
How do these HTML changes behave in the PDF format?
Since the latex package for FA does not account for these parameters, they are only for HTML outputs, e.g., exactly as "group" added by @jjallaire
I think we should try to match the FA sizing commands you added to standard latex size commands: \tiny
, \scriptsize
, \small
, \large
, etc.
Well, this is tricky to match the two.
name | pt | em-ish |
---|---|---|
\tiny | 5 | 0.5 |
\scriptsize | 7 | 0.7 |
\footnotesize | 8 | 0.8 |
\small | 9 | 0.9 |
\normalsize | 10 | 1 |
\large | 12 | 1.2 |
\Large | 14.4 | 1.44 |
\LARGE | 17.28 | 1.728 |
\huge | 20.74 | 2.074 |
\Huge | 24.88 | 2.488 |
what about just adding latex command name as allowed values for pdf?
For reference, FA allows the following for HTML:
Relative sizing: {{< fa brands github size=2xl >}}
Relative Sizing Class | Font Size | Equivalent in Pixels |
---|---|---|
fa-2xs | 0.625em | 10px |
fa-xs | 0.75em | 12px |
fa-sm | 0.875em | 14px |
fa-lg | 1.25em | 20px |
fa-xl | 1.5em | 24px |
fa-2xl | 2em | 32px |
Literal sizing: {{< fa brands github size=5x >}}
Literal Sizing Class | Font Size |
---|---|
fa-1x | 1em |
fa-2x | 2em |
fa-3x | 3em |
fa-4x | 4em |
fa-5x | 5em |
fa-6x | 6em |
fa-7x | 7em |
fa-8x | 8em |
fa-9x | 9em |
fa-10x | 10em |
@cscheid Here a first attempt by simply adding the command names and checking their validity. I also documented these in the example and readme files.
I finally implemented new css classes (https://github.com/mcanouil/fontawesome/blob/2d7172af7c6afffb4d50ea91e3f5a295fc30543b/_extensions/fontawesome/assets/css/latex-fontsize.css) to allow to use LaTeX font size commands for both formats with the following font sizes between the two formats.
Sizing Command | Font Size (LaTeX) | Font Size (HTML) |
---|---|---|
tiny (= \tiny ) |
5pt | 0.5em |
scriptsize (= \scriptsize ) |
7pt | 0.7em |
footnotesize (= \footnotesize ) |
8pt | 0.8em |
small (= \small ) |
9pt | 0.9em |
normalsize (= \normalsize ) |
10pt (document size) | 1em |
large (= \large ) |
12pt | 1.25em |
Large (= \Large ) |
14.4pt | 1.5em |
LARGE (= \LARGE ) |
17.28pt | 1.75em |
huge (= \huge ) |
20.74pt | 2em |
Huge (= \Huge ) |
24.88pt | 2.5em |
@mcanouil That looks really great, thank you! Looks ready to merge. I'm just going to confirm if we need you to sign a contributor agreement (I'm sorry, I should have brought that up sooner) and I'll get back to you.
No worries, I think I (already) signed something like that for https://github.com/rstudio/webshot2/pull/36 (If I recall properly, it was mandatory).
Ok, I asked around and we don't need it for this case. Thank you much for the contribution! 🚀
This PR does:
README.md
:>
in shorcodes (#2 #5 #9){
and}
(only needed within Quarto document) (#5 #9)fontawesome.lua
:size=...
https://fontawesome.com/docs/web/style/size (#4)title=...
and addsaria-hidden="true"
to the HTML code (#8)