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
can someone help me? #221
Comments
Hi, |
yes we have but it ttf we have definition of bold and italics, can't we somehow get that |
Hi! You can check in the OS2 table in Maybe you will find something interesting with sFamilyClass or Panose…! See official reference: https://www.microsoft.com/typography/otspec/os2.htm#fc |
|
yes I can get the weightclass but I want to change it so that if it was 400, I change it to 800 and it changes the font weight |
You can directly read and write the When exporting the font that value will be in the final .otf file see https://github.com/nodebox/opentype.js/blob/1b1679efa2047e54cab12580b3a6f879524e707f/src/tables/sfnt.js#L231 |
ok I think I am not clear enough, I would really appreciate if you help me @Jolg42 I am using following
Now here I want to define that use bold, use italic or use bold italic, something like this to get the exact output can you please help me how to do that? |
@fahadnabbasi Like I said, you can't load a font and change the weight or style of the output path. If you want to use |
oh the solution provided by @Jolg42 will not change the fontweight? currently for my font the value is 400, if I change it to 800, will it not work? And if it doesn't work, how can I extract the different fonts from one single .ttf file? The reason I am confused is because on html or canvas, if I use the same file, I can apply bold, italic and normal properties and they work fine but no way to do it using font.getPath function |
Sorry @fahadnabbasi changing the As @fpirsch said if you need multiple weights you will need to load each subfamily separately. |
You can try to unpack your font with http://transfonter.org/ttc-unpack |
ok so is there a way I can extact that from .ttf? I don't have .ttc |
You can try, maybe you have a .ttc named .ttf, that can happen! |
unfortunately this is not the case, so do I have to find all the different font files for every single font and all its sub families? |
So yes, but you can also try to open your font in FontForge or FontLab & try to export the subfamilies. |
@fahadnabbasi A standard Browsers know where too look for the correct font file. Either you give them the correct file list in the CSS @font-face declaration, or they use font files installed locally, or they can sometimes fake bold and italic by just drawing a thicker or slanted path. But this only works when you display text in your browser in the standard way, either with html or
|
I am loading .ttf font file and now I want to add in the weight and style for it but getPath only expects font size, is there a way I can define the weight and style for font? e.g.
Bold, Italic
or Bold, normal
or normal, normal
The text was updated successfully, but these errors were encountered: