Open adrfantini opened 5 days ago
#fa-intergral
should not work since I haven't paid for the Pro set and only generated functions for icons in the Free set.
Could you please try using the font directly like this:
// `text` enables ligature by default, and I think if this works, then `fa-icon` should work
#text("integral", font: "Font Awesome 6 Pro")
// Use Unicode instead of ligature. I found the Unicode on Font Awesome's website.
#text("\u{f667}", font: "Font Awesome 6 Pro")
If the second one works but the first one does not, maybe we need to check the other two options for ligatures: https://typst.app/docs/reference/text/text/#parameters-discretionary-ligatures
If the second one doesn't work either, maybe Font Awesome Pro needs some settings I need to know. 😢
#fa-intergral
should not work since I haven't paid for the Pro set and only generated functions for icons in the Free set.Could you please try using the font directly like this:
// `text` enables ligature by default, and I think if this works, then `fa-icon` should work #text("integral", font: "Font Awesome 6 Pro") // Use Unicode instead of ligature. I found the Unicode on Font Awesome's website. #text("\u{f667}", font: "Font Awesome 6 Pro")
If the second one works but the first one does not, maybe we need to check the other two options for ligatures: https://typst.app/docs/reference/text/text/#parameters-discretionary-ligatures
If the second one doesn't work either, maybe Font Awesome Pro needs some settings I need to know. 😢
using text("integral"...
does not work
using text("\u{f667}"...
works! (however this is not acceptable in my case since I need icon name-based automation)
However, setting either discretionary or historical ligatures to true
does not change the outcome 😢
Is there anything I can do to test this more or to help you test this?
However, setting either discretionary or historical ligatures to
true
does not change the outcome
This sounds weird since Font Awesome, as its docs say, supports ligatures for the Free and Brands set. I think there might be some issues between how Typst handles ligatures and what Font Awesome expects.
To solve this issue, I have two ideas:
fa-icon-map
by hand and pass it to fa-icon
(A lot of dirty work)However, setting either discretionary or historical ligatures to
true
does not change the outcomeThis sounds weird since Font Awesome, as its docs say, supports ligatures for the Free and Brands set. I think there might be some issues between how Typst handles ligatures and what Font Awesome expects.
To solve this issue, I have two ideas:
- If the icons you want to use have limited numbers, you can create a
fa-icon-map
by hand and pass it tofa-icon
(A lot of dirty work)- Try using icons in Word, Photoshop, and other design tools and see whether ligature works. If the ligature works, let's open an issue at Typst's original repo.
I added the icons to my system, then in Libreoffice Writer copied the glyph from the FA website, and pasted. This is the result:
Have you tried ligature? I mean, type in integral
in LibreOffice.
using
text("integral"...
does not work usingtext("\u{f667}"...
works!
Your environment may have something weird.
I downloaded an OTF of Font Awesome 6 Pro Regular 6.0.0
from the network (though this is not legal) and used it for a simple test. Everything is working fine.
My environment
typst 0.11.1 Using
typst --font-path . c example.typ
to compile
I'd like to know which version of typst you are using and how your files are organized.
Sorry for the delay and thank you for your help!
Here's my code with details in comments:
#import "@preview/fontawesome:0.2.1": *
// Using typst 0.11.1 (50115102) on ArchLinux
// Compile command:
// typst compile --font-path . test.typ
// Dir tree
// .
// ├── fa-regular-400.ttf
// ├── test.pdf
// └── test.typ
// Fonts:
// typst fonts --font-path . | grep --color=auto 'wesome'
// Font Awesome 6 Pro
#set text(size: 2em)
OK:
#fa-icon("ban", font: "Font Awesome 6 Pro")
#fa-ban(font: "Font Awesome 6 Pro")
OK:
#fa-icon("chess-queen", font: "Font Awesome 6 Pro")
#fa-chess-queen(font: "Font Awesome 6 Pro")
OK:
#fa-icon("github", font: "Font Awesome 6 Pro")
#fa-github(font: "Font Awesome 6 Pro")
// Use Unicode instead of ligature. I found the Unicode on Font Awesome's website.
OK:
#text("\u{f667}", font: "Font Awesome 6 Pro")
#text("\u{f667}", font: "Font Awesome 6 Pro", discretionary-ligatures: true)
#text("\u{f667}", font: "Font Awesome 6 Pro", historical-ligatures: true)
NOT OK:
#fa-icon("integral", font: "Font Awesome 6 Pro")
// `text` enables ligature by default, and I think if this works, then `fa-icon` should work
NOT OK:
#text("integral", font: "Font Awesome 6 Pro")
#text("integral", font: "Font Awesome 6 Pro", discretionary-ligatures: true)
#text("integral", font: "Font Awesome 6 Pro", historical-ligatures: true)
And here is the output:
As for ligatures in Libreoffice, they also do not work:
// Dir tree // . // ├── fa-regular-400.ttf
I notice that you are using a ttf version. I don't know whether this is the cause.
As far as I know, Font Awesome's guide only mentions otf. Maybe the support of otf in Typst and LibreOffice is a little different from ttf?
A discussion on Figma's forum says that ttf doesn't support ligature. If so, I recommend trying the otf version of Font Awesome.
Hi, I am struggling with Pro icons. The following code works for all icons, except
integral
:Result:![image](https://github.com/duskmoon314/typst-fontawesome/assets/12826141/ab84eef4-2326-4987-9fc4-89c1dfcb4cf0)
This happens for all Pro icons that I tested.
The output of
typst fonts --font-path .
includesFont Awesome 6 Pro
, so that should be good. I have no other FA fonts installed, so it clearly is getting some fonts.I have converted the FA .ttf file to .ttx to extract the glyphs, and the file contains a
<GlyphID id="2616" name="integral"/>
. Additionally it has the following:so I think the glyph is correctly present.