Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Firefox font package #42

Open
KrasnayaPloshchad opened this issue Mar 20, 2018 · 6 comments
Open

Create Firefox font package #42

KrasnayaPloshchad opened this issue Mar 20, 2018 · 6 comments

Comments

@KrasnayaPloshchad
Copy link

KrasnayaPloshchad commented Mar 20, 2018

Firefox is allowed to load fonts from extension, on AMO site there are some extensions contains font files to allow users that do not already have the required fonts installed on their systems, with such add-on any page which specified using Ponomar Unicode or Monomakh Unicode (or you have written specific user style) will be proper rendered on both desktop and mobile devices. One notable example is here: MathML-fonts.

You can get documents from MDN: https://developer.mozilla.org/en-US/Add-ons

@typiconman
Copy link
Owner

Fonts can be loaded using CSS. What's the point of loading fonts in an extension? I don't understand.

@KrasnayaPloshchad
Copy link
Author

There are two key points of loading fonts in an extension. First, you can write a CSS file, which contains some @font-face rules to specify which fonts included in extension can be used. For example, the MathML-fonts extension has a CSS file including following rules:

@font-face {
    font-family: Latin Modern Math;
    src: local('Latin Modern Math'), local('LatinModernMath-Regular'), url('fonts/LatinModern/latinmodern-math.woff2');
}

Second, you need prepare font files to pack, WOFF formats would be better choice. In an extension these fonts should better put into specific folder.
You can also try to see its strucure directly via Extension source viewer which allow to see the source of any extension.

@typiconman
Copy link
Owner

OK, but what are the benefits of this over using embedded fonts (which is what we do now)?

@KrasnayaPloshchad
Copy link
Author

This extension has benifits especially in Firefox for Android, after installation, this extension would help to some pages which used your fonts your fonts but not embedded them to make them render correctly. For example: https://en.m.wikipedia.org/wiki/O_(Cyrillic)

@typiconman
Copy link
Owner

I'll put this in the "some day" category.

@KrasnayaPloshchad
Copy link
Author

Fonts can be loaded using CSS. What's the point of loading fonts in an extension? I don't understand.

Now you can see their source code via an online source if you want to know about, then you will see the good point.
https://robwu.nl/crxviewer/?crx=https%3A%2F%2Faddons.mozilla.org%2Ffirefox%2Fdownloads%2Ffile%2F630669%2Fmathml_fonts-3.0-an%2Bfx.xpi%3Fsrc%3Ddp-btn-primary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants