Closed cellio closed 1 year ago
I forgot that I made that post 👀
Actually, I believe the easiest way to do this is just add lang
as a permitted attribute here: https://github.com/codidact/qpixel/blob/f200846d89d03f6cc3cbc1f910e7c40374f2acbc/app/helpers/posts_helper.rb#L15
@MoshiKoi the lang attribute indicates language, not font
Through another thing is, we don't have span
allowed (if this goes through, maybe we should). Without it, we won't be able to switch language inline, which while inconvienient isn't particularly blocking.
@ArtOfCode- Ay, but the specific issue on the linked post ended up being language considerations
@cellio As a representative of the Judaism community (which is the other community with major font considerations), would you prefer having a specific font for Hebrew, different from the English font?
@MoshiKoi we want to be able to paste Hebrew into the post box and have it Just Work. If we would have to do manual HTML edits, that would be a regression for us. We found a font that has a reasonable Hebrew in its stack. (Waves hands; I don't know if I'm correctly describing this. I don't know a lot about fonts; msh210 might be able to provide better input.)
@cellio Of course, we'd still have a fallback font stack. This would just be on top of it, not replacing it. However, while it might work for Judaism, a pure font stack is... less than feasible for Languages. For example, lets say we have a font stack of X, Y where X looks great for Hebrew and English, but looks terrible for Greek, while Y looks great for Greek but terrible for Hebrew. What's the solution?
Now multiply that problem by 10+ different scripts.
Right, I wasn't trying to say that what works on Judaism, where we need to support two primary languages, works everywhere. I was just trying to answer your question about usage on Judaism. I don't know enough about fonts to have a useful opinion on how to solve the general problem.
@cellio I wasn't trying to force my method on Judaism either, it's just that it would affect it and I was wondering if there were special considerations needed.
How would things change for Judaism? Assume nobody does any special language tagging in HTML and we continue to cut/paste Hebrew into posts and comments. Does that Hebrew rendering change?
@cellio no, it wouldn't. However, they'd get the choice to start tagging the language, so it'd still affect them, even if not in a major way.
Oh yeah, I forgot to mention this, but there are also some QoL stuff that could be added with lang attributes like
[lang='he'], [lang='ar'] /* and whatever other RTL languages there are */ {
direction: rtl;
}
Which would right-justify Hebrew and Arabic texts.
The HTML version of this works (demonstrated in an answer on the linked question). No markdown, but with the HTML I think we can close this.
https://languages.codidact.com/questions/277352
Support for other alphabets/languages is iffy. One approach is to expand the font stack (Noto was mentioned there). Another is to enable language tagging (requires HTML; Markdown doesn't support this). If we can do it with additions to the font stack (without causing other problems) that sounds like the friendliest approach, but I don't know how feasible it is.