Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

stretchy characters in firefox mobile (android)

61 views
Skip to first unread message

David Carlisle

unread,
Sep 19, 2011, 12:06:27 PM9/19/11
to dev-tec...@lists.mozilla.org

Hi,

Testing MathML on an Android device (using text/html html5 style markup
if it makes any difference). Can stretchy characters be made to work?

Looking at

http://monet.nag.co.uk/~dpc/stfmml.html

the mathml layout is understood but the stretchy () brackets come out as
a vertical stack of missing glyph boxes.

I tried to make the stix fonts available using @font-face:

http://monet.nag.co.uk/~dpc/stfmml2.html

using a set of pre-cobverted fonts I found at

http://hublog.hubmed.org/archives/001931.html

although that isn't a full set and I'm not sure how (or of it's
possible) to refer to the fonts used for internal glyph mappings for
stretchy characters, or if @font-face works on firefox mobile.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

Karl Tomlinson

unread,
Sep 19, 2011, 11:36:04 PM9/19/11
to
David Carlisle writes:

> Testing MathML on an Android device (using text/html html5 style
> markup if it makes any difference). Can stretchy characters be
> made to work?
>
> Looking at
>
> http://monet.nag.co.uk/~dpc/stfmml.html
>
> the mathml layout is understood but the stretchy () brackets come
> out as a vertical stack of missing glyph boxes.

Assuming this is due to a lack of font support on the device for
these characters, we probably need bug 663740 [4] to stop the
missing glyph boxes showing.

>
> I tried to make the stix fonts available using @font-face:
>
> http://monet.nag.co.uk/~dpc/stfmml2.html
>
> using a set of pre-cobverted fonts I found at
>
> http://hublog.hubmed.org/archives/001931.html
>
> although that isn't a full set and I'm not sure how (or of it's
> possible) to refer to the fonts used for internal glyph mappings
> for stretchy characters, or if @font-face works on firefox mobile.

I haven't tested on mobile but I expect @font-face to work there.

It's a bit lucky that @font-face works with stretchy operators at
all in Gecko, because the implementation was well before
@font-face, but, with some caveats, things can be made to work.

The font family needs to be specified for the :-moz-math-stretchy
pseudoelement to override the browser CSS [1], and it needs to
include the family name used in the @font-face rule.

Only stretchy characters that can be built from Unicode characters
can be constructed using @font-face families. [2]
(The generic solution is [3], but that is a lot of work.)

STIX fonts have their characters divided into multiple font faces,
so it's tricky to use the STIX fonts in the official form.

I've attached an example using DejaVu Serif.
The local() references avoid the download on systems that already
have the font. I guess some format() values and other quirks
should be added to make things work properly across browsers.

[1] http://hg.mozilla.org/mozilla-central/annotate/ea2f892d9439/layout/mathml/mathml.css#l410
[2] http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathfontUnicode.properties
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=407059
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=663740

djvmml.html

David Carlisle

unread,
Sep 20, 2011, 6:43:57 AM9/20/11
to dev-tec...@lists.mozilla.org
On 20/09/2011 04:36, Karl Tomlinson wrote:

> The font family needs to be specified for the :-moz-math-stretchy
> pseudoelement to override the browser CSS [1], and it needs to
> include the family name used in the @font-face rule.
>
> Only stretchy characters that can be built from Unicode characters
> can be constructed using @font-face families. [2]
> (The generic solution is [3], but that is a lot of work.)

Thanks, I feel I'm getting closer, but not quite there, yet.

> I've attached an example using DejaVu Serif.

I got dejavu serif set up as a web font kit from

http://www.fontsquirrel.com/fonts/DejaVu-Serif#fontface

and modified your example, hopefully as intended:


http://monet.nag.co.uk/~dpc/djvmml.html

it looks OK on my desktop but the mobile version is still showing boxes
for the brackets.

any further thoughts (or anyone else with firefox mobile who could see
if it works for them?)

Patrick Ion

unread,
Sep 20, 2011, 9:52:15 AM9/20/11
to dev-tec...@lists.mozilla.org
On 9/20/11 6:43 AM, David Carlisle wrote:
> On 20/09/2011 04:36, Karl Tomlinson wrote:
>
>> The font family needs to be specified for the :-moz-math-stretchy ..
> Thanks, I feel I'm getting closer, but not quite there, yet.
>
> > I've attached an example using DejaVu Serif.
>
> I got dejavu serif set up as a web font kit from
>
> http://www.fontsquirrel.com/fonts/DejaVu-Serif#fontface
>
> and modified your example, hopefully as intended:
>
>
> http://monet.nag.co.uk/~dpc/djvmml.html
>
> it looks OK on my desktop but the mobile version is still showing
> boxes for the brackets.
>
> any further thoughts (or anyone else with firefox mobile who could see
> if it works for them?)
This looks interesting, but gives boxes on my HTC Sensation with
FireFox Beta (and certainly Internet doesn't do right).

On the Mac OS X 10.6.8 iMac it does fine in Safari 5.1 (6534.50),
Firefox 7.0
Sea Monkey 2.3.1, but not in Chrome 14.0.835.163 .

However the Android development kit shows things as they should be in
Fennec.

Patrick

Karl Tomlinson

unread,
Sep 20, 2011, 6:26:55 PM9/20/11
to
David Carlisle writes:

> I got dejavu serif set up as a web font kit from
>
> http://www.fontsquirrel.com/fonts/DejaVu-Serif#fontface
>
> and modified your example, hopefully as intended:
>
> http://monet.nag.co.uk/~dpc/djvmml.html
>
> it looks OK on my desktop but the mobile version is still showing
> boxes for the brackets.

The subsetting Font Squirrel provided has removed the characters
need for building the parentheses from parts (U+239B, etc).

You can select "Don't Subset" which makes the files somewhat
larger.

It would probably be possible to use fontforge or something to
delete glyphs to pick the subset that you want, but I don't know
whether you want to get into that.

David Carlisle

unread,
Sep 20, 2011, 6:35:57 PM9/20/11
to dev-tec...@lists.mozilla.org
On 20/09/2011 23:26, Karl Tomlinson wrote:
> The subsetting Font Squirrel provided has removed the characters
> need for building the parentheses from parts (U+239B, etc).

ah. will try again, I didn't notice it was subsetting, sorry:-)

--
google plus: https:/profiles.google.com/d.p.carlisle
Message has been deleted

Patrick Ion

unread,
Sep 21, 2011, 8:52:24 AM9/21/11
to dev-tec...@lists.mozilla.org
On 9/21/11 7:47 AM, David Carlisle wrote:
>
> Karl and I chatted about this off list for a bit and he found the
> missing link, there are different versions of the dejavu fonts available:
> ....
> so now I have mathml including stretchy characters on my galaxy tab,
> hooray!
>
> thanks again,
>
> David
>
> Test file, now working for me:
>
> http://monet.nag.co.uk/~dpc/djvmml.html
>
Well done!. I get the correct display on an HTC Sensation running
Android 2.3.4
with FF Beta. It looks as on the desktop, but rather smaller.

Patrick


0 new messages