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

What are each project used for? #99

Closed
Happypig375 opened this issue Feb 18, 2018 · 10 comments
Closed

What are each project used for? #99

Happypig375 opened this issue Feb 18, 2018 · 10 comments

Comments

@Happypig375
Copy link
Contributor

It seems like Typography.OpenFont and Typography.GlyphLayout are the most important ones.
While digging through the demos (also note the weird namings of them),
I see that Typography.Contours are also used.
This makes me wonder what each project is supposed to provide.

@prepare
Copy link
Member

prepare commented Feb 18, 2018

  1. Typography.OpenFont
  • This project is a core project, no dependency on others.
  • This project contains a font reader that implements Open Font Format,
    (ISO/IEC 14496-22:2015 , and Microsoft OpenType Specification)
    and Web Open Font Format (both WOFF 1.0, 2.0)
  • OpenType GSUB, GPOS layout mechanism are 'sleep' in here.
  • No Visual/Graphics Rendering Here

  1. Typography.GlyphLayout

since GlyphLayout engine is not stable and quite complex,
I separated this from the OpenFont core project

  • This project invokes OpenType Layout Engine/Mechanism (esp. GSUB, GPOS) inside the
    Typography.OpenFont
  • The engine converts a string to a glyph-index List and substitutes some glyph,
    and place them into a proper position by the request 'settings'
    eg see Add ScriptLang ComboBox #82,
    or Emoji Font :) #18
  • No Visual/Graphics Rendering Here

With Typography.OpenFont + Typography.GlyphLayout

you can use the font data/ text/ glyph position to
render to 'your' render surface.

I provide the example for this

eg ...

or other projects that use only 2 libs and render the data to their surfaces.

see ...

MatterControl_Typography
pic1 MatterControl (https://github.com/MatterHackers/MatterControl) with Typography

@Happypig375
Copy link
Contributor Author

What about Typography.Contours and others?
Typography.Contours targets .NET Framework 2.0 and cannot be referenced from .NET Standard 2.0.

@prepare
Copy link
Member

prepare commented Feb 18, 2018

But when I want to parse a long text and render like this ...


The HtmlRenderer example!

This is a snapshot of Html drawboard from (https://github.com/LayoutFarm/HtmlRenderer).
The glyphs are generated/layouted with our Typography, and rendered with
the PixelFarm (https://github.com/PaintLab/PixelFarm)

html_renderer_with_selection2
pic 1: HtmlRenderer on GLES2 surface, text are renderered with the Typography


I need more functions about how to parse a long text
and layout it.

So I need more functions, Those are in development stages.


  1. Typography.TextServices

    This is a hub of doing some advance things about how to parse a long text and layout them
    The project contains 2 sub-projects( TextBreak and TextFlow)


  1. Typography.TextBreak
  • This implements text-break engine.

  • Implements how to break a long text to a list of 'textspan'
    for some languages(eg English) , a text can be parsed into a list of textspan by whitespace break
    but some languages (eg Thai, Laos) can't, They need more advance parsing algorhytm eg=> Dictionary Breaking Engine.


  1. Typography.TextFlow
  • This implements text flow. How to flow a text into a specific shape area.

@Happypig375
Copy link
Contributor Author

This should probably be put in README.

@prepare
Copy link
Member

prepare commented Feb 18, 2018

  1. FontAtlas see

You can see in the pic1 that I render the Html into OpenGLES2 surface.

Rendering a text on GLES2 surface may has multiple ways

One technique is using Font texture atlas.

I provide How to create font Atlas in the project


@prepare
Copy link
Member

prepare commented Feb 18, 2018

  1. Msdf Texture see

    When we talk about FontAtlas.
    There are many kind of Font Atlas.

    If you need scalable texture font with 'Sharp' edge=>
    one of them is Multi-channel signed distance field (Msdf) Texture

    I also 'port' Multi-channel signed distance field (Msdf) Texture
    (https://github.com/Chlumsky/msdfgen) from C/C++ to C#

@prepare
Copy link
Member

prepare commented Feb 18, 2018

  1. Typography.Contours
  • This is a developing project.
  • I use this for glyph shape analysis/study.
  • I try to implement AutoHint here

eg.

glyph_analysis_fit_e_21

pic 1: grid w,h (1px,10px)

glyph_analysis_fit_u_21
pic 2: grid w,h (1px,10px)

(see PaintLab/PixelFarm#4 , #37)

@prepare
Copy link
Member

prepare commented Feb 18, 2018

Under development Typography.Contours


Century font, A, 460pts

glyph_analysis_a_40
pic 1: master outline

glyph_analysis_a_46

pic 2: from 1

glyph_analysis_a_41
pic 3: from 1, master outline with edge offset -10px (thin)

glyph_analysis_a_47
pic 4: from 3

glyph_analysis_a_42
pic 5: from 1, master outline with edge offset +10px (thick)

glyph_analysis_a_45

pic 5: from 4

@prepare
Copy link
Member

prepare commented Feb 18, 2018

Naming something sometimes quite hard :)

Welcome all new suggestions about that.

@prepare prepare closed this as completed Feb 18, 2018
@Happypig375
Copy link
Contributor Author

Can you post this useful information at README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants