CSharpMath icon indicating copy to clipboard operation
CSharpMath copied to clipboard

custom font don't stretch up

Open prok155 opened this issue 3 years ago • 3 comments

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 avatar May 20 '22 12:05 prok155

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

Happypig375 avatar May 20 '22 18:05 Happypig375

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

Happypig375 avatar May 20 '22 18:05 Happypig375

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

prok155 avatar May 23 '22 20:05 prok155