How to convert text to SVG paths?

I have created my own class to process SVG font file and to turn text into glyphs. Example of using: include “SVGFont.php”; $svgFont = new SVGFont(); $svgFont->load(“/path/to/font.svg”); $result = $svgFont->textToPaths(“Simple text”, 20); Example result: <g transform=”scale(0.009765625) translate(0, 0)”><path transform=”translate(0,0) rotate(180) scale(-1, 1)” d=”M92 471l183 16q13 -110 60.5 -180.5t147.5 -114t225 -43.5q111 0 196 33t126.5 90.5t41.5 125.5q0 … Read more

Using custom font in a UIWebView

After some Try and Error I have found a reliable way to load custom Fonts with a local CSS. 1. Add your Font to the App…make sure that the file is targeted properly to the Application 2. Then add your Font to yourApp-Info.plist 3. Run NSLog(@”Available fonts: %@”, [UIFont familyNames]); To check which name the … Read more

Finding out what characters a given font supports

Here is a method using the fontTools Python library (which you can install with something like pip install fonttools): #!/usr/bin/env python from itertools import chain import sys from fontTools.ttLib import TTFont from fontTools.unicode import Unicode with TTFont( sys.argv[1], 0, allowVID=0, ignoreDecompileErrors=True, fontNumber=-1 ) as ttf: chars = chain.from_iterable( [y + (Unicode[y[0]],) for y in x.cmap.items()] … Read more

Setting custom font

Firstly gain an URL to the Font. Then do something like this. ‘Airacobra Condensed’ font available from Download Free Fonts. import java.awt.*; import javax.swing.*; import java.net.URL; class LoadFont { public static void main(String[] args) throws Exception { // This font is < 35Kb. URL fontUrl = new URL(“http://www.webpagepublicity.com/” + “free-fonts/a/Airacobra%20Condensed.ttf”); Font font = Font.createFont(Font.TRUETYPE_FONT, fontUrl.openStream()); … Read more

What is the status of TTF support in Internet Explorer?

So as I mentioned in my question above, Internet Explorer has some ttf support starting with version 9, but “only working when [fonts are] set to be installable”. Some background: …TrueType fonts have embedding “bits” which allow the creator of the font to decide the level of embedding that will be permitted. There are four … Read more