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

custom font don't stretch up #208

Open
prok155 opened this issue May 20, 2022 · 3 comments
Open

custom font don't stretch up #208

prok155 opened this issue May 20, 2022 · 3 comments
Labels
Status/0. New This issue is new and is awaiting confirmation from the maintainers. Type/Bug

Comments

@prok155
Copy link

prok155 commented May 20, 2022

Describe the bug

Recently I have decided to use custom font instead of default font. I have a little problem because some glyphs don't stretch up and it looks wierd when I display it. I don't know if there is a problem with my font or there is a bug in the library.

To Reproduce

  1. Download font from link https://drive.google.com/file/d/1eYEoNWXoonjhSVx_AN_H0pghTOnjT8WC/view?usp=sharing
  2. AddOverride above font
  3. You will see that some glyphs don't stretch up ( Newton symbol, square roots)

Expected behavior

All glyphs should stretch up.

Additional context

Screens (Newton symbol, square root)
screen2
screen1

@prok155 prok155 added Status/0. New This issue is new and is awaiting confirmation from the maintainers. Type/Bug labels May 20, 2022
@Happypig375
Copy link
Collaborator

Does your font set OTF math tables? Without correct information you will not get stretched glyphs.

@Happypig375
Copy link
Collaborator

Ah a TTF font. You should edit your font to use OTF math tables instead.

@prok155
Copy link
Author

prok155 commented May 23, 2022

Hey. I converted my font to OTF and I have a little problem. When I add my font, sometimes text is not visible. I thought that there is something wrong with my font, but I added default CSharpMath font and this bug also occurs. See screen below.
Here is the code:
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream("latinmodern-math.otf"))
{
CSharpMath.Settings.GlobalTypefaces.AddOverride(new Typography.OpenFont.OpenFontReader().Read(stream));
}
textView.LaTeX = "Sample text $$x+3$$";

As you see, when I AddOverride default CSharpMath font, a part of text is invisible. Is there something wrong with above script?

screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status/0. New This issue is new and is awaiting confirmation from the maintainers. Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants