qpixel icon indicating copy to clipboard operation
qpixel copied to clipboard

Community ads sometimes show ?? for non-UTF8 characters

Open cellio opened this issue 4 years ago • 6 comments

https://meta.codidact.com/posts/280879

A picture is worth a thousand words:

ad with broken title

A commenter suggests a UTF8 encoding/decoding hiccup.

cellio avatar Mar 10 '21 01:03 cellio

Nothing to do with encoding/decoding - it's the same problem we had with Hebrew characters. The font we're using doesn't include them, and because it's in an image there's no way to fall back to an alternative font for unsupported characters.

It's possible to sort of graft those extra characters on as we did for Hebrew, but where do you draw the line? I'm not about to start sourcing and merging every possible Unicode character - let alone licensing issues.

ArtOfCode- avatar Mar 20 '21 23:03 ArtOfCode-

Oh, I didn't realize it was a font problem. (I'd forgotten how you'd solved this for Hebrew.) I take it there's no font out there that's more inclusive (and licensable)? For ads, it doesn't matter as much if it's a little more ugly, while we would care about that for a body font used all over the site.

cellio avatar Mar 21 '21 01:03 cellio

Do the community ads that are generated from questions have to be images? I'm sure I have seen this bug recently.

The font we use to generate the Ad images is Roboto?

Trilarion avatar Jan 11 '22 17:01 Trilarion

A recent Meta post popped up. Somehow, it's gotten worse (or maybe it hadn't hit this edge case?); some characters are not shown at all

The community ad is supposed to read "What is ทำดีได้อย่าเด่นจะเป็นภัย in Thai?", but instead, completely removes the Thai characters, not even leaving the user any indication that something was there.

image

MoshiKoi avatar Jun 11 '23 03:06 MoshiKoi

I raised the priority because this is impeding community promotion and keeps popping up. That said, I see the "hard" label. Priority, not urgency.

cellio avatar Jun 11 '23 03:06 cellio

Art mentioned in an earlier comment that we can't use a fallback font for unsupported characters because it's an image. Just wondering if there is a way to generate the text up front, with a fallback font for the unsupported characters, and only then convert to an image?

When I say "a way" I mean a straightforward way, preferably short of using a browser to generate the rendered text and then taking an automated screenshot. If we can find a way, then hopefully future missing characters will just require adding a new fallback font rather than manually merging.

trichoplax avatar Jun 11 '23 15:06 trichoplax