Closed Bug 1727990 Opened 5 years ago Closed 5 years ago

Font problem in edit mode

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 91
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: walt.tuvell, Unassigned)

Details

Attachments

(2 files)

Attached file Chrome-v-FIrefox.pdf —

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Visit my webpage https://readingma.us, using these credentials:
User = TestOne
Password = 4zLWMVjL",=jD`6P
Go to the page https://readingma.us/Home/AdminTools/TestPage1. You will see you have edit privileges on that page. Click into edit mode, and look at the editing box. The problem is the font in this box. It's different in Chrome (say) than it is in Firefox. I want it the font to be DejaVuSans, and that's what it is in Chrome, but in Firefox it's DejaVuSansMono. I don't know where the bug lies, but until proved differently I'm assuming it's in Firefox.

Actual results:

See attached pics.

Expected results:

Described above, see attached pics.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

Inspecting the editor frame there, it's styled with font-family: DejaVuLGCSansMono, Arial, Verdana, sans-serif; (coming from https://readingma.us/core/modules/ckeditor/css/ckeditor-iframe.css). Here, I see Arial getting used, as I don't have a font matching "DejaVuLGCSansMono" installed, but I guess on your system that name is being recognized.

Does fontconfig recognize it, if you run fc-match :family=DejaVuLGCSansMono, for example? This looks to me like it may be an "alternate" family name, as I'd expect the primary name to be "DejaVu LGC Sans Mono" (with spaces), but Firefox does try to match alternate names when they're present in the font.

Thank you for helping me look at this. Here are a few responsive remarks:

  1. I am technical, but not so much with web technologies, I'm just boot-strapping myself here.
  2. I see what you're saying, by going into Inspector in both FIrefox and Chrome. See new pics posted (temporarily) at https://f002.backblazeb2.com/file/PublicSharedFiles/Chrome-v-Firefox%2C2.pdf.
  3. Both Firefox and Chrome show the same font-family string you quote, yet they manifestly display differently (font-wise) on-screen. Why?
  4. You shouldn't need to have DejaVuLGC/whatever/ installed on your machine, because I supply it for you (using FontYourFace in Drupal, and you're right I'm using my own "alternate" name for the well-known fonts).
  5. You say you're seeing Arial (presumably you mean in Firefox). Are you sure? I've added some numerals to that page now, and I'm seeing DejaVuLGCSansMono (notice the dotted-zero).
  6. You may have clued me into part of my problem here, namely that .css file. What I really want is: (i) DejaVuLGCSans in CKEDIT REGULAR EDIT mode, but (ii) DejaVuLGCSansMono in CKEDIT SOURCE EDIT mode. I can look further into that later, but first I'd like to understand the above questions (1–5) better first.

Thanks again in advance!

Attached file Chrome-v-Firefox,2.pdf —

Ah, I see. The "outside" page (or the content when in View mode, rather than Edit) does use your DejaVu webfonts. But in Edit mode, the webfonts are ignored and it just uses the system's installed Arial or Helvetica. I'm seeing this in all of Firefox, Safari and Chrome on macOS, by the way -- none of them use the DejaVu webfont in edit mode.

I think this is because the editor is an embedded iframe, which does not have access to the webfont resources loaded by the parent page. If you want the webfonts to be available within the iframe, that document also needs to load them.

What you get in Chrome on Linux may depend what fonts are present on the system and how fontconfig is set up; if you don't have an actual Arial or Verdana installed, then some kind of alias or substitution may be happening, and this may not behave the same in Firefox vs Chrome. But I think your main issue is that the webfonts from the main page are simply not available to the iframe content.

Yeh, what you say makes sense (thanks!), and it tracks what I was sort-of seeing, but I wasn't knowledgeable enough to put it all together. Still a couple of gaps in my understanding, but closer now. So since this isn't something I can probably fix (sounds like source-hacking I'm not up to), who do you think I should go talk to about this now (if you're familiar enough about the players)? It appears not to be browser-land, or OS-land, right? So maybe Drupal? CKedit (that's my guess)? Bootstrap (Barrio)?

I'm not familiar with these tools/resources, but from what I see on your page, I'm assuming CKedit is some kind of online editor library or component that's embedded in your site, so I guess you need to consult its documentation (or its developers, if documentation doesn't help) about how to include your intended webfont resources within the embedded editor. I'm assuming it's likely to have some mechanism for you to link additional stylesheets to the document within the iframe it creates.

Cool, so what I'll do next it talk to CKEdit (https://ckeditor.com/), and point them to this page. Hopefully they'll own the problem, and one of us (me or CKEdit) will post here. Thanks!!
[BTW, that pic previously posted on BackBlaze is now posted in this thread.]

From the last few comments, it sounds like we can close this as "invalid", i.e. there's not actually any valid Firefox bug here after all.

Though feel free to reopen if I'm misunderstanding (in which case, please accept my apologies).

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: