LaTex like fonts #68
Replies: 1 comment 3 replies
-
Hi @flavioschneider, thank you for your interest in the lib. Complex math notation is is a tricky use case ! I think it's possible though, but you may have to manually write the characters definitions in the font JSON. Here is the content of the JSON generated by the font generator for the font Roboto with just the letter "a" : {
"pages": ["Roboto-Medium.png"],
"chars": [
{
"id" : 97,
"index" : 69,
"char" : "a",
"width" : 23,
"height" : 27,
"xoffset" : 0,
"yoffset" : 11,
"xadvance" : 23,
"chnl" : 15,
"x" : 0,
"y" : 0,
"page" : 0
}
],
"info" : {
"face" : "Roboto-Medium",
"size" : 42,
"bold" : 0,
"italic" : 0,
"charset" : ["a"],
"unicode" : 1,
"stretchH" : 100,
"smooth" : 1,
"aa" : 1,
"padding" : [2,2,2,2],
"spacing" : [0,0]
},
"common": {
"lineHeight" : 44,
"base" : 34,
"scaleW" : 256,
"scaleH" : 256,
"pages" : 1,
"packed" : 0,
"alphaChnl" : 0,
"redChnl" : 0,
"greenChnl" : 0,
"blueChnl" : 0
},
"distanceField" : {
"fieldType" : "msdf",
"distanceRange" : 4
},
"kernings" : []
} What matters for you here is the content of the However you may have to make a PR to add a little feature, which I would gladly merge. There is currently no support for character horizontal offset, the horizontal positioning is computed from the char width. Related issue : #22 This is where the lib computes each character anchor point.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Felix! Love this library. I was wondering if you have any idea on how LaTex like fonts for math notation could be integrated with this library, for example see https://katex.org/. I've done some research on how to build a custom MSDF fonts, but I'm still not sure if it is possible to have composable characters in any way (e.g. integration or summation symbols). Thanks!
Beta Was this translation helpful? Give feedback.
All reactions