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

Bold and Italic fonts #142

Open
charlesroddie opened this issue Jun 26, 2020 · 3 comments
Open

Bold and Italic fonts #142

charlesroddie opened this issue Jun 26, 2020 · 3 comments
Assignees
Labels
Status/2. Work in progress A branch has been created or a user has taken the work to implement this issue. Type/Bug

Comments

@charlesroddie
Copy link
Collaborator

LaTeX:

@"This is normal text, with an equation $e=mc^2$, and here is some \textbf{bold text}, and here is some \textit{italic text}."

Loading fonts:

let getFont(path:string) =
    use stream = System.IO.File.OpenRead path
    Typography.OpenFont.OpenFontReader().Read(stream)
textPainter.LocalTypefaces <-
    [   getFont @"Assets\OpenSans-Regular.ttf"
        getFont @"Assets\OpenSans-Bold.ttf"
        getFont @"Assets\OpenSans-Italic.ttf" ]

Expected (Microsoft Word rendering):

image

CSharpMath:

image

Issues:

  • Spacing is too large
  • The bold and italic fonts do not get used

Perhaps the TextPainter API should have a settable RegularFont, BoldFont, and ItalicFont?

@charlesroddie charlesroddie added Type/Enhancement Status/0. New This issue is new and is awaiting confirmation from the maintainers. labels Jun 26, 2020
@Happypig375
Copy link
Collaborator

Happypig375 commented Jun 26, 2020

The bold and italic fonts do not get used

The bold and italic glyphs used are in the Unicode range https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols. Fonts should provide glyphs for characters in this range instead of the ASCII range.

@Happypig375 Happypig375 added Status/1. Ready This issue has been confirmed and is ready to be worked on. Type/Bug and removed Status/0. New This issue is new and is awaiting confirmation from the maintainers. Type/Enhancement labels Jun 26, 2020
@Happypig375
Copy link
Collaborator

Spacing is too large

Looks like a bug.

@Happypig375
Copy link
Collaborator

I assume the FontStyles branch is linked to this bug. Assigned to @charlesroddie.

@Happypig375 Happypig375 added Status/2. Work in progress A branch has been created or a user has taken the work to implement this issue. and removed Status/1. Ready This issue has been confirmed and is ready to be worked on. labels Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status/2. Work in progress A branch has been created or a user has taken the work to implement this issue. Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants