How to control the default fontsize when creating ttf file using fontforge? - fontforge

I am deploying fontforge (python script )to create ttf file. I found the fontsize is a little small when using it in android phone. But I don't know how to tune the default fontsize when creating ttf.
So my question is How to control the default fontsize when creating ttf file using fontforge? Any suggestion will appreciated.

The apparent size of a font is determined by the font metrics and the size of the glyphs you draw. Here are my instructions for how to achieve sensible sizing: http://benwhitmore.altervista.org/line-spacing-getting-right/

Related

Why does font-icon render outside of its content area? and how to fix it?

I have a .woff font file consisting of font-icons. These icons are rendered differently in Mac and in Windows. I suspect the reason to be different Win Ascent/Descent and HHead Ascent/Descent values in font metrics.
This icon-font file is generated from svg files using webfonts-generator package
Here is the snapshot of same icon rendered in both mac and windows
Mac:
Windows:
could anyone tell me how to fix this?
may be your line-height is less than font-size

If you can dynamically change the font in the terminal like you can with CSS

I have seen these two questions:
Can I change the font of terminal?
Is it possible to show mathematical symbols in the terminal?
The answer to both is yes.
I am wondering if it is possible to have a CLI print out mathematical symbols into the terminal from a custom font only it is personally using, while at the same time I never have to change the font on my terminal (I can keep using the default font for everything else). That is, say I have my default font for my terminal set to x. The CLI program would have downloaded and have a local copy of font y. Then the CLI sets the font type to font y for the terminal, draws some stuff in font y, and then sets it back to font x before closing. That way the terminal still has its original font but it was also able to display symbols (like math symbols) from another font. Wondering if this is in any way possible.
I'm imagining this sort of like how you have font-families in CSS. In CSS, you can provide a downloaded font to the end user's browser to display the text using a different font than what they have as the default in the browser. Wondering if you can do this same sort of thing with the terminal. Specifically I am on the Mac using iTerm2, but knowing if it's possible there or on any other terminal would be useful to know.
Not really. In principle you can switch fonts with the ANSI escape code ESC [ 11m where 11 can be any of the “fonts” between 10 and 20 inclusive with 10 being the default. You would have to load an appropriate font first (setfont?).
In practice no terminal emulator actually supports this (I've heard that pangoterm does).
The usual workaround is to create a patched Unicode font that encodes additional symbols in private-use areas, and configure your terminal emulator to use that font. However, your programs would then have to output the correct codepoints, you can't locally switch the font for ASCII. Font patching is e.g. suggested by the Powerline vim extension.
In X applications, font substitution already does what you describe. By default, when a font does not have a certain glyph, it is substituted from a different font. The details are customisable in /etc/fonts/fonts.conf, there are several GUI configuration tools for that.
Screenshot: Konsole 18.04, configured font for application is DejaVu Sans Mono size 16, beer mugs glyph substituted from Symbola

How can I manage css and php gd2 font size?

Font size of php gd2 and css is different.
How can I manage it?
Any formula to manage it?
Because when I send a string with font size in css it prints much larger in php gd2 than css font.
Please tell me some ideas to manage it.
in different versions of php_GD there different types of fonts. if you are using php-gd2 font type is used pt (point) not px. and in first php-gd i think px is font unit.

How do you get the system default font size in Qt?

Qt uses 9px as default font size, but users (on Linux) can change this by using qtconfig.
So, how do I get the system default font size? I read the documents, but I can not find any API.
Get a default font QFont object and read the size from it.
Your application default font can be obtained from QApplication::font(), which
Returns the default application font.
And you can gather a size of it using pointSize(),pointSizeF(),pixelSize(), etc.

Large Web Font (Yes or No?)

I want to use special font on my website, but the file is over 9 MB. Is it possible to reduce font's size? Thanks folks!
If the font's EULA allows it, you can shrink down the number of glyphs in an OpenType font using FontForge.
Unless this site is being served over a LAN connection, using a 9MB font is ridiculous. That would force each user to be downloading a 9mb file just to view the font you use. You would be much better off picking a font that everyone has.
www.fontsquirrel.com offers the font-face kit section that converts fonts for you - one of the choices is to have a subset of glyphs - only uppercase or just numbers. That might help to reduce the size. Typically fonts served as WOFF are below 100kb.
Even if you shrink the font, most users' web browsers won't download or display it.
http://www.webdirections.org/blog/the-return-of-font-embedding-to-the-web/

Resources