scratchfoundation / scratch-paint

Paint editor for Scratch 3.0
https://llk.github.io/scratch-paint/
BSD 3-Clause "New" or "Revised" License
175 stars 229 forks source link

Unsupported glyphs are cut off in Firefox #481

Open chrisgarrity opened 6 years ago

chrisgarrity commented 6 years ago

Expected Behavior

Non-latin characters should render properly even if they do not exist in the currently selected font.

Actual Behavior

The size rendered on the stage appears to be related to the height of the font selected. If the glyphs don't exist in that font, they are rendered in a default system font and get cut off if the size of the system font is larger than the one selected.

screen shot 2018-05-25 at 12 59 06 pm

Steps to Reproduce

Operating System and Browser

Mac OS 10.13.4, Firefox

fsih commented 6 years ago

In Paper, text height is calculated using expected height of the font size plus leading, without actual measuring. This does not work when a fallback font ends up being used for some characters.

The height calculation also includes the comment // Until we don't have baseline measuring, assume 1 / 4 leading as a // rough guess: Implying that not enough information is known to get an accurate measurement.

fsih commented 6 years ago

@BryceLTaylor sorry if I confused you, I was having a hard time finding a repro. I think I have one, but I wonder if there are more?

  1. In the vector editor, type a single line of greek in the pixel font
  2. Switch costumes
  3. Switch back
  4. Add more lines to the one line of text. Now the text gets cut off in the renderer

I've only seen this on Mac Firefox so far