Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# lib for processing font files - TTF (TrueType), others [closed]

Any known C# library or project out there that can understand the TTF file format? Most questions Ive seen regarding this are attempting to do custom rendering, but I'm more interested in a font editor type of application.

like image 392
Brady Moritz Avatar asked Jan 07 '11 17:01

Brady Moritz


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

What is C full form?

History: The name C is derived from an earlier programming language called BCPL (Basic Combined Programming Language). BCPL had another language based on it called B: the first letter in BCPL.


2 Answers

I want to introduce another pure C# lib for processing font. Here https://github.com/LayoutFarm/Typography

Pure C#

support .NET >=20

access general glyph data,

and access advanced typography data.

(such as GDEF,GSUB,GPOS) etc.


The below image shows some screen snapshot,

compare then lib's rendering glyph 'B'

  1. (left) : glyph from the lib without Hinting

  2. (middle) : Windows's GDI with clear type (from notepad)

  3. (right): glyph from the lib with True Hinting

enter image description here


snap 2: I'm developing auto-hint, and grid fitting.

test it out, and feel free to comment, fork, discuss.

triangulate1


snap 3: subpixel rendering

subpixel_rendering

like image 185
WinterDev Avatar answered Oct 17 '22 10:10

WinterDev


Don't know what you want to do exactly, but WPF has a cool GlyphTypeface Class that is quite abstract and quite independent.

This is how you can start with:

GlyphTypeface ttf = new GlyphTypeface(new Uri(@"c:\windows\fonts\verdana.ttf"));

There are also the GlyphRun Class and the GlyphRunDrawing Class.

Otherwise, if you're looking for the big picture, open-source, you can also check the FreeType Project, available here: http://freetype.org/

like image 32
Simon Mourier Avatar answered Oct 17 '22 08:10

Simon Mourier