Page MenuHomePhabricator

Support dynamic fonts (CSS 3 @font-face, ttf/otf/eot, web fonts, WOFF)
Closed, ResolvedPublic

Description

Author: santhoshguru

Description:
The Tamil wikipedia as such is not dynamic fonts enabled. So if it is viewed in
a computer where the specified fonts are not available, the characters are
unintelligible. So can you enable dynamic fonts for the Tamil Wikipedia.

I have the dynamic font file (.EOT file) , for the Tamil font. I also know the
file (/skins/monobook.php) where to go and do the change for enabling the
dynamic fonts.

Any developer who is going to take this issue can just send a mail to
santhoshguru@gmail.com , I will send the .EOT file and my recommended changes
that has to be done in the .PHP file.

Thanks,
Santhosh


Version: unspecified
Severity: enhancement
URL: http://ta.wikipedia.org

Details

Reference
bz2361

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:33 PM
bzimport set Reference to bz2361.
bzimport added a subscriber: Unknown Object (MLST).

santhoshguru wrote:

Contains the .EOT file and the proposed new monobook.php

I have attached the dynamic font file (THENEE.EOT), a style sheet
(dynamic-font.css), a PHP file (monobook.php) and a Readme.txt file which has
what to do.

(I was not aware of the create attachment functionality, thats why I has asked
to mail me and get the file from me. But now I have attached all the required
files in the ZIP file)

Attached:

Is there any copyright and license information for the font file? It needs to be public domain or
reasonably GPL-compatible for us to redistribute it.

What's the expected browser compatibility? How would it affect browsers that don't support that
system?

santhoshguru wrote:

(In reply to comment #0)

The Tamil wikipedia as such is not dynamic fonts enabled. So if it is viewed in
a computer where the specified fonts are not available, the characters are
unintelligible. So can you enable dynamic fonts for the Tamil Wikipedia.

I have the dynamic font file (.EOT file) , for the Tamil font. I also know the
file (/skins/monobook.php) where to go and do the change for enabling the
dynamic fonts.

Any developer who is going to take this issue can just send a mail to
santhoshguru@gmail.com , I will send the .EOT file and my recommended changes
that has to be done in the .PHP file.

Thanks,
Santhosh

(In reply to comment #2)

Is there any copyright and license information for the font file? It needs to

be public domain or

reasonably GPL-compatible for us to redistribute it.

What's the expected browser compatibility? How would it affect browsers that

don't support that

system?

The EOT file is a public domain file. There will not be any copyright issues
regarding that.
The browsers that wouldnot support the EOT file will not displaying the text as
we see it (without the EOT file in the supported browser).

To put more clearly, if the browser doesnot support the EOT file, the default
font of the browser will be taken.

avarab wrote:

please supply unified diffs and attachments rather than a ZIP file

santhoshguru wrote:

  1. The font definition file: Copy the attached 'thenee.eot' file to the

following location: /skins/monobook/.

  1. An add-on stylesheet that calls for this font file and adds the required

declarations to various html element tags. Copy the 'dynamic-font.css' file to
the same location: /skins/monobook/.

In the line number 55 of the file /skins/MonoBook.php, after the following line

<!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath')
?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->

insert the following code

<!-- Start of the code -->
<?php
#Begin

Dynamic font style sheet hack by Kasi Arumugam April 13, 2005

?>

<!--[if IE]><style type="text/css">@import "<?php $this->text('stylepath')

?>/<?php $this->text('stylename') ?>/dynamic-font.css";</style><![endif]-->
<?php
#End
?>
<!-- End of the code -->

santhoshguru wrote:

CSS file

Attached:

santhoshguru wrote:

Dynamic Font File

Attached:

gangleri wrote:

Dear Santhosh!

Thanks for the help at [[ta:project:Font_help]]. Would it be possible to create
a section containing both a screen shot and a sample text to be displayed side
by side?

I think either at a sentence equivalent to "The quick brown fox jumps over the
lazy dog." or another text containing all characters. This will help people to
see if all required characters are display properly or not.

Thanks in advance!

best regards reinhardt [[user:gangleri]]

P.S. Please verify if this request is only related to installations at WikiMedia
foundations projects or if it is necessary / suitable for all MediaWiki
installion using Tamil as content language. Please verify also if this request
is related only to "OS" Windows XP and "Hardware" PC. Please change "Product",
"Component", "OS", "Hardware" if necessary.

gangleri wrote:

P.S. Does this request cover also Tamil sister projects?
See [[wiktionary:ta:Wiktionary:font_help]].

Is this something we need? What browsers support dynamic fonts? Is it common that users are unable to edit because of missing font? Is this compatible with Unicode? Are the existing ways documented in that font help page not enough?

Adding a note that Safari 3.1 and upcoming Firefox 3.5 and Opera 10 support regular TrueType and OpenType fonts with @font-face. If we can generate .eot files as well for IE, doing this for several languages might be helpful.

http://techblog.wikimedia.org/2009/05/firefox-i18n-and-downloadable-fonts/

This should be available not just on Tamil Wikipedia. I can easily imagine it being useful on every WMF project and MediaWiki in general.

A very generic example: articles about languages and alphabets in every Wikipedia.

A less generic example: Gesenius' Hebrew Grammar on the English Wikisource has passages in Biblical Hebrew on every page and it needs a font which isn't installed on most people's computers. Fortunately, this font, called "Ezra SIL SR", is Free Software, released under the Open Font License, but few people who would be interested in reading this book have the technical knowledge or patience to download and install a new font.

Ideally, font files would be uploaded to Commons, but since they may have very intricate copyright problems, the developers may upload a limited number of Free license-checked fonts to a server which is not too open. I don't imagine that a huge number of font files would be needed anyway and there aren't a lot of Free Software fonts to begin with.

ayg wrote:

There are potentially serious issues with including zillions of web fonts that may or may not be needed. Some of them are big downloads, and WebKit refuses to lay out text until the font is downloaded. If a local font has the characters, that would be greatly preferable.

Would font-family: sans-serif, mycustomfont; mean "use mycustomfont, but only if the characters aren't available in the default local font"? The CSS 3 Fonts spec says it should, but CSS 2.1 seems vague; does it work in practice, and if so, in what browsers? In particular, do browsers download the font unnecessarily? Do they support unicode-range (I'm guessing IE doesn't)?

In an ideal world, it *should* be safe to have some custom font-families defined, and do something like this on all wikis:

html { font-family: sans-serif, Wikimedia-custom-font; }
#p-lang { font-family: sans-serif; /* avoid downloading custom fonts just for interlanguage links */ }

I don't know if that would work in the real world without unpleasant side effects.

If we can use unicode-range effectively, then we can just deliver existing free fonts. If it's not, then we should combine the ones we need into a single file, so that browsers don't have to download a bunch of files in a row to figure out which one has the characters they actually need.

A lot depends on browser implementation here. If some browser doesn't support falling back on a character-by-character basis, then it will be a lot more painful to support this effectively. In fact I guess it would be impossible, for that browser, to automatically use web fonts without screwing up people's choice of default fonts for some of the text. Is anyone willing to test out IE, Firefox 3.5, and the appropriate Safari version to see how they behave?

  • Bug 25220 has been marked as a duplicate of this bug. ***

Have we considered introducing a magicword/parserfunction that loads a font like that on the fly, for one page ? With the new resourceloader that might be an option.

Together with our foreign language templates, that could prove rather useful. We'd need:

  • a directory of free webfonts
  • a way to load a single font
  • a way to load a font for an entire wiki.

Possibly use lazyloading of fontfaces, as described by: http://www.stevesouders.com/blog/2009/10/13/font-face-and-performance/

Adding a comment with the word WOFF, which is the name of a modern related
standard, to make this bug easier to find.

Think the webfonts extension (under development at http://gitorious.org/webfonts-mediawiki-extension) would handle this.

Gerard.meijssen wrote:

The WebFonts extension is now in SVN. Yes it will cope with these things. It already copes with Tamil, Oriya, Malayalam, Hebrew..

What is really relevant the base technology will work for any device that supports proper Unicode... That does include many if not most smart phones.

As I have blogged, it works for Hebrew; this is necessary because many fonts out there are considered inadequate for the proper rendering of the Hebrew language.
Thanks,

GerardM

http://ultimategerardm.blogspot.com

This extension covers the non-mobile sites, but what about the mobile? Problems with unavailable fonts are remarkable in mobile devices. In some cases the user has no (easy) option to install new fonts, and it looks like these webfonts could be a solution to this problem.

Currently only a few mobile browsers support it, but if we have a precedent (iOS apparently supports it) then it is easier to go to other mobile browser maintainers and file a feature request.

The current mobile gateway site (en.m.wikipedia.org etc) is external to MediaWiki so won't automatically get extra styles we add in for webfonts, but it could be treated separately (and we should make sure that when it's integrated back into MediaWiki itself that we keep those abilities).

Will probably need to break out a separate bug with mobile-specific issues; for mobile browsers viewing the main MediaWiki sites, standard stuff should kick in where supported.

(In reply to comment #21)

Will probably need to break out a separate bug with mobile-specific issues; for
mobile browsers viewing the main MediaWiki sites, standard stuff should kick in
where supported.

Done: Bug 28515 - Dynamic fonts support in mobile gateway

I would be interested for the transliteration or any such thing for Odia Wikipedia (or.wikipedia.org) in this localization context.
Subha Pa (Subhashish Panigrahi)
or.wikipedia.org

Transliteration extension? See bug #20246

sundarbecse wrote:

(In reply to comment #26)

http://www.mediawiki.org/wiki/Extension:WebFonts resolved this. Support for
Tamil is also already in place.

Thanks Santhosh.

  • Bug 32063 has been marked as a duplicate of this bug. ***