freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] How write a shape in real size


From: Werner LEMBERG
Subject: Re: [ft-devel] How write a shape in real size
Date: Sat, 01 Feb 2014 19:13:55 +0100 (CET)

> I found a interesting example
> http://www.freetype.org/freetype2/docs/tutorial/example3.cpp
>   (in http://www.freetype.org/freetype2/docs/tutorial/step3.html)
> 
> How I can change this source to use real dimension/size?
> for example how create page 10x12 cm and simple rectangle 3cm, in 80 dpi

Here you can find some basics

  http://msdn.microsoft.com/en-us/library/windows/desktop/ff684173(v=vs.85).aspx

Of course, the code snippets in this link are specific to Windows and
don't apply to FreeType.
  
> How convert x,y of vector data (in example Vec2 k_shape...) to real
> unit: mm, points, inch etc.

See above.  Note that the vector data is normally stored in 26.6
format, cf. https://en.wikipedia.org/wiki/Fixed-point_arithmetic – in
other words, a stored value 1 corresponds to the real value
1/64 = 0.015625


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]