mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Specific ligatures not working

Open Ciflire opened this issue 1 year ago • 5 comments

Problem

In rust-by-practice code block i found that some ligatures of MonoLisa won't render and make the dots in ..= and .= invisible, where it should render like that image

Steps

  1. Go on rust by practice
  2. Use monolisa font (or maybe some others)
  3. write ..= inside a code block

Possible Solution(s)

No response

Notes

it does work in monolisa playground and typst online editor, so i fugured it might come from here It does render inside of code block, but not input code block

Version

Could not figure out from the github repo

Ciflire avatar Mar 11 '24 20:03 Ciflire

Thanks for the report! I'm not sure what monalisa is, but the fonts are defined by the book's CSS. In particular, code blocks use "Source Code Pro", which is a different font. If you are overriding the fonts, you will need to make sure they are overridden for all places fonts are defined.

ehuss avatar Mar 11 '24 20:03 ehuss

sry, monolisa font* Also, it's overriden everywhere on the page cause other ligatures work like arrows image to be more specific, it works everywhere here, except on line 7, where ".." disappears and as you can see this specific ligature does work on the page, just inside those specific input code blocks

Ciflire avatar Mar 11 '24 20:03 Ciflire

Hm, I don't see anything at https://github.com/sunface/rust-by-practice/tree/master/en that indicates that the font is being overridden, and the fonts are the normal fonts when I open the given link. Are you using a local override?

Regardless, we have noted issues in the past (like #1061) where the ACE editor is sensitive to the font that is used, and the CSS was adjusted to prevent those overrides.

ehuss avatar Mar 11 '24 20:03 ehuss

yeah i'm locally overriding this

Ciflire avatar Mar 11 '24 20:03 Ciflire

Have you tried enabling more font features? Took a bit of searching but when you scroll down far enough, the specimens page of MonoLisa lists the font feature needed for each ligature set. For your case it seems to be SS17.

shenef avatar Mar 11 '24 21:03 shenef