Discourse lettertype weergave

Hello,

I’m running into a font rendering issue while using a custom Urdu font i.e. Jameel Noori Nastaliq (a variant of Noto Nastaliq Urdu) in Discourse. My setup is:

  • Browser: Chrome Version 138.0.7204.183

  • Font: Jameel Noori Nastaliq

  • Platform: Discourse (I am using theme component following this)

Problem

When I apply Jameel Noori Nastaliq to Discourse, the text does not render as expected:

  • Certain words are shaped incorrectly. In the attached image, the text on the right shows how Discourse currently renders it, whereas the left shows the expected rendering (using the same font and browser).

  • Other urdu fonts (non-Nastaliq) display correctly in the same environment.

  • Additionally, Noto Nastaliq Urdu renders with an unusually large font size compared to other fonts. This makes the text appear oversized and inconsistent with the rest of the UI.

What I’ve Tried

  • Testing multiple Nastaliq fonts: All Nastaliq fonts i.e. Jameel, Mehr and Noto has this issue.

  • Comparing with different browsers: (tested on Firefox/Edge)

  • Verifying CSS overrides: The font is correctly applied via @font-face and loaded by Discourse.

Expected vs Actual

  • Expected: Correct Nastaliq ligatures and proportional sizing (see left side of image).

  • Actual: Broken word shaping and oversized text (see right side of image).

Has anyone else run into this issue with Noto Nastaliq Urdu on Chrome + Discourse? Is this a Chrome shaping bug, a font issue, or something in the way Discourse handles custom fonts?

Thanks in advance for any guidance.

2 likes

There’s a chance Discourse is doing something to the fonts with regards to font weights.

Are you familiar with css? You may be able to tweak some of the font weight variables defined in Styling Discourse with variables: Show & Tell in a theme component.

4 likes

yes, I think it’s mainly the bolding that’s causing the distortion.
Either turn off all the bold fonts with a global overrule, or make sure that the font you’re using has a specific bold variant.

I read that this one might work betterr: Jameel Noori Nastaleeq Kasheeda: Download for free at Urdu Fonts : Urdu Fonts

2 likes

Bedankt voor uw reactie. Ik zal doorgaan met het uitschakelen van de vetgedrukte lettertypen. Hoe denkt u dat het makkelijker zal zijn om dit te doen?

1 like

Hmm, to be very thorough, adding this to your custom css should work:

* {
  font-weight: normal !important;
 }

@chapoi Unfortunately this is not working. What do you think about

overflow-wrap: break-word;
white-space: nowrap;
text-overflow: ellipsis;

These three are common to these words

1 like

Geen van die zal iets doen voor je lettertype.

Ik heb mijn oplossing lokaal geprobeerd, en dat leek het probleem op te lossen. Zeg je dat de css niet wordt toegepast, of wordt deze wel toegepast maar lost deze het probleem niet op?

@chapoi thank you. What I want to say that CSS rule is applied but it is not producing desired effects. Below are the links for you to reproduce what I am experiencing

/* Jameel Noori Nastaliq v4 */
@font-face {
  font-family: "Jameel-Noori";
  src: url("https://cdn.jsdelivr.net/npm/jameel-noori/fonts/jameel-noori-nastaleeq4.woff2") format("woff2"),
  url("https://unpkg.com/jameel-noori/fonts/jameel-noori-nastaleeq4.woff2") format("woff2");
}

This perticular varient is producing this sort of overlapped characters and is miles away from desired effect which is down there.

/* Mehr Nastaliq Web Font v2 */
@font-face {
  font-family: "Mehr";
  src: url("https://cdn.jsdelivr.net/npm/mehr-nastaliq/fonts/mehr.woff2") format("woff2")
}

Het probleem wordt veroorzaakt door de standaard CSS-lettertypefuncties van Discourse die de weergave van complexe scripts verstoren:

css

// Problematische standaardinstellingen
font-variant-ligatures: none;
font-feature-settings: "calt" 0;

// Oplossing is om te overschrijven
font-variant-ligatures: normal;
font-feature-settings: normal;

Dit loste het probleem met beide lettertypen op.

2 likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.