duskmoon314 / typst-fontawesome

A Typst library for Font Awesome icons through the desktop fonts.
https://typst.app/universe/package/fontawesome
MIT License
12 stars 0 forks source link

Unexpected linebreak in heading/list #2

Open jlduu opened 11 months ago

jlduu commented 11 months ago

Please see screenshot 微信截图_20230803132504

duskmoon314 commented 11 months ago

Weird output to me. I might need to check what happens.

duskmoon314 commented 11 months ago

This occurs when using the ligatures of Font Awesome in a heading or list item:

// A weird newline occurs
- test #fa-icon("chess-queen") test
- test #text(font: "Font Awesome 6 Free", "chess-queen") test

// No newline occurs
- test #fa-chess-queen() test
- test #text(font: "Font Awesome 6 Free", "\u{f445}") test

I have yet to find out what is different in headings and lists. Currently, I can only suggest using fa-<icon name> instead of fa-icon(<icon name>).

jlduu commented 11 months ago

This occurs when using the ligatures of Font Awesome in a heading or list item:

// A weird newline occurs
- test #fa-icon("chess-queen") test
- test #text(font: "Font Awesome 6 Free", "chess-queen") test

// No newline occurs
- test #fa-chess-queen() test
- test #text(font: "Font Awesome 6 Free", "\u{f445}") test

I have yet to find out what is different in headings and lists. Currently, I can only suggest using fa-<icon name> instead of fa-icon(<icon name>).

Thanks, it works. The problem might be with typst itself.

duskmoon314 commented 3 weeks ago

I recently released v0.2.1. `fa-icon currently looks up icons in a map and uses Unicode to render the icon. So, in most cases, this would not happen.

This might happen if the user uses this package with FontAwesome Pro. There is no map for the Pro set now, and ligatures are used.