Page MenuHomePhabricator

Define CSS classes for scripts with web fonts
Open, LowPublicFeature

Description

It would be useful if ULS could provide CSS definitions like

.script-buginese {
font-family: Saweri, sans-serif;
}

Currently one has to use a lang="bug" on the element, but this isn't ideal from a semantical point of view, as the Buginese script isn't used to only write Buginese language, but also for some other languages. So in an article about the script it isn't correct to add language attributes. With such classes authors could easily tell ULS to embed the fonts to display the characters to all users.


Version: unspecified
Severity: enhancement

Details

Reference
bz51662

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:48 AM
bzimport set Reference to bz51662.
bzimport added a subscriber: Unknown Object (MLST).

i think this satisfies your requirement. It's documented on [[mw:Extension:Universal_Language_Selector#Alternate_ways_to_load_fonts]]:

Alternate ways to load fonts, By specifying font-family

Inside the wiki text <span style="font-family:'YourFontName';">YourText</span>, webfonts extension will check whether the font is available with the extension, if so it will download it to the client.

There are some advantages the classes have:

  • They are more descriptive. <span class="script-buginese">some text</span> is more obvious than <span style="font-family: Saweri, sans-serif;">some text</span>. You had to look up the exact font names in the documentation, while you could use classes without doing so (if you know the English name of the script).
  • They are shorter.
  • Classes can be used in advance, even if there is currently no font for the script. Then it will work once a font is added to ULS.
  • Users can override the fonts in their common.css if they have a font installed for a script they like better.

Isn't the wiki way to write a template ala {{script-buginese|Text goes here}}? That way the communities themselves can also decide which font they want to use without us dictating it.

In my opinion adding such classes to ULS would entail quite a maintenance burden.

(In reply to comment #3)

In my opinion adding such classes to ULS would entail quite a maintenance
burden.

Somebody has to maintain the classes/templates/whatever, to keep them up to date with the fonts provided by ULS. I don't see a reason why this maintenance should be done by the single wiki communities. When you add, change or remove a font from ULS, you have to update the central config files and automatically re-build the others anyway, so why shouldn't there be a file with CSS definitions like above which is updated along with these files?

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: wikibugs-l-list.