Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

The Roboto font doesn't render correctly in editor view

Open Fallgrim opened this issue 2 months ago • 11 comments

Markpad version

2.7.6

How did you install it?

Windows — installer (Markpad_…_setup.exe)

OS and version

Windows 10

What happens, and what you expected instead

  • I prefer using Roboto on my files, and when I choose it in Markpad, the font doesn't render correctly the alternate Latin letters like ş-ğ.
    • (The Roboto font supports all alternate Latin letters normally.)
  • I use the same font in other editor apps, but there is no such thing, so the font is okay.
  • It renders correctly in the "preview mode" with the exact same font, so the problem is in the "editor view" as far as I can understand.
  • So, I think there is just a minor bug in the editor view, could you check it out, please?
  • (The problem remains still even in different font sizes.)

(Here is a screenshot of it.) Image

Steps to reproduce

  1. Open the app.
  2. Click setting > Editor > Font > Select Roboto
  3. Go to editor view or split view, doesn't matter.
  4. Write down these letters "ş - s" to see the difference in the editor section, but there is no any problem in the preview section.

Edit:

  • Also other fonts don't respond to the "word wrap" setting when I select the "window" option. Some of them work well, but others cut the line half as if I'm in the split view, but I'm not. Here are the screenshots of the problem as you can understand it clearly. The first doesn't continue further, but the second completes the windows as it should be.

  • Image

  • Image

Fallgrim avatar Sep 07 '26 12:09 Fallgrim

Thanks for the screenshots. These turned out to be two different problems.

Word wrap stopping early: confirmed. The editor decided where to wrap by assuming every letter is the same width. That is true for fonts like Consolas, but not for Times New Roman or Roboto, so lines broke too early. #766 fixes it.

ş and ğ in Roboto: when a font is missing a letter, the editor borrows it from Consolas, while the preview borrows it from a regular sans-serif font that looks close to Roboto. So my best guess is that the Roboto installed on your PC does not include these letters. Could you check two things?

  1. Press Win+R, type charmap, choose Roboto, and look for ş.
  2. In Settings > Preview > Font, is the preview also set to Roboto?

PathGao avatar Sep 10 '26 14:09 PathGao

The word wrap fix (#766) is merged. It will be in the next release, after 2.7.6. Once you update, lines in Times New Roman, Roboto and other non-monospace fonts should wrap at the window edge.

For ş and ğ, I still need your answer to the two questions above: does Roboto show ş in Character Map, and is the preview font also set to Roboto?

PathGao avatar Sep 11 '26 11:09 PathGao

I've just checked and yes, the character is shown in Character Map; I've added the screenshot below. Also, as I mentioned above, I don't see this kind of error while using other editors, so that means Roboto font is okay, right? It's universal font, so it supports this kind of alternate Latin letters natively, but I couldn't get why I have this issue, sorry about that.

Image

Fallgrim avatar Sep 11 '26 12:09 Fallgrim

Thanks for checking, and no need to apologize. That rules out my guess: your Roboto does have ş.

I tried Roboto in the same editor component Markpad uses and ş came out exactly like normal text, so I can't reproduce this yet. It may be specific to Windows. One quick test would tell us where to look:

  1. Set the editor font to Roboto.
  2. Type this on one line: ssssssssssssssssssss
  3. And this on the line below: şşşşşşşşşşşşşşşşşşşş
  4. Do both lines end at the same place? A screenshot would help.

Also, in Settings > Preview > Font, which font is selected?

PathGao avatar Sep 11 '26 12:09 PathGao

  • Editor mode:
    • Image

  • Preview mode:
    • Image

  • It seems the problem continues in both modes.

  • Additionally, this is another screenshot with the exact same letters and the same font, but in different editor app.
    • Image

Fallgrim avatar Sep 11 '26 12:09 Fallgrim

Thanks, these screenshots settle it. In Roboto, s and ş are exactly the same width, so the two lines should end at the same place. In Markpad they don't: in the editor the ş line is longer, and in the preview it is shorter. That means ş is not being drawn with Roboto there. Markpad asks Windows for Roboto, gets a copy without ş, and borrows the letter from another font: Consolas in the editor, a sans-serif font in the preview. Your other app draws both lines the same length, so it is using a different copy of Roboto, or one built into the app.

So the most likely cause is the Roboto installation rather than Markpad. Could you try this?

  1. Open Settings > Personalization > Fonts, search for Roboto, and uninstall every Roboto entry.
  2. Check C:\Users<your name>\AppData\Local\Microsoft\Windows\Fonts for any Roboto files left behind.
  3. Install Roboto again from https://fonts.google.com/specimen/Roboto.
  4. Restart Markpad and repeat the two-line test.

If the lines still differ after that, let us know and we'll dig further.

PathGao avatar Sep 11 '26 14:09 PathGao

Thanks man. Windows doesn't let me to uninstall them. It says the font is being used right now, so I can't delete it. I'll search workarounds. Sorry to bother you for this kind of personal issue.

Thanks again.

Fallgrim avatar Sep 12 '26 09:09 Fallgrim

  • Hey, I've just checked everything again, and was able to deleted those files completely, and this time, I've downloaded static fonts for Roboto (Regular, bold, italic and bolditalic).
  • Also, I've consulted to an AI for this issue. It suggests:

Could you please check the web/bundler configurations, Google Fonts API calls, or self-hosted font files to ensure the full latin-ext subset is explicitly included and loaded?

  • I've seen this issue is a minor detail for me at first, but as I've given so much time on it, I want to accomplish it. So, as I couldn't understand exactly what AI meant by this request, could you try it if it's available for you? Thanks again.

Fallgrim avatar Sep 12 '26 16:09 Fallgrim

No bother at all. That AI suggestion doesn't apply here: Markpad doesn't bundle or download any font. It lists the fonts installed on your PC and asks Windows for them by name, so there is no subset for us to extend. The only font files shipped with the app are KaTeX's math symbols.

Here is what your screenshots actually show, since it explains the odd part of this report.

In Roboto, s and ş have exactly the same width, so your two test lines should end at the same place. I measured them:

  • editor, 16px: 20 × s is 164px wide, 20 × ş is 174px
  • preview, 15px: 20 × s is 153px wide, 20 × ş is 149px
  • your other app: both lines 98px, identical

So in Markpad neither pane is drawing ş with Roboto. When the font a page asks for has no glyph for a character, the browser engine falls back to the next font in the list, one character at a time. The editor's list ends in Consolas (a monospace font, so ş came out wider, and it looks out of place among the Roboto letters), and the preview's ends in a generic sans-serif (slightly narrower). Same cause, two different-looking results. Your other app draws both lines the same, so it is getting a Roboto that does have ş, or is using a copy built into the app.

That leaves the question of why Character Map shows ş in Roboto. Character Map and the browser engine pick font files through different Windows APIs, so when more than one Roboto is installed — or one is installed only for your user account — the two can end up looking at different files.

Where that leaves us:

  1. After your reinstall, does the test still fail? Please type the two lines again (20 × s, 20 × ş) with Roboto selected and check whether they now end at the same place.

  2. If they still differ, right-click the Roboto .ttf files and choose "Install for all users". Fonts installed only for your own account are not always visible to the browser engine Markpad runs on, which is one way it could be getting a different copy than Character Map shows. Restart Markpad afterwards.

  3. A check that does not involve Markpad at all: save this as test.html in Notepad and open it in Microsoft Edge, which uses the same engine as Markpad.

    ssssssssss
    şşşşşşşşşş

    If the lines differ in Edge too, the problem is in how Windows hands Roboto to that engine rather than in Markpad.

PathGao avatar Sep 13 '26 02:09 PathGao

Thanks again man, I really appreciate.

Yes, it does differ in Edge too. I've rename the Original Roboto font with their metadata as "Roboto 2" and now it works.

Edit: Also, when the new update will be released?

Fallgrim avatar Sep 13 '26 07:09 Fallgrim

probably this week

PathGao avatar Sep 13 '26 14:09 PathGao