freetype
[Top][All Lists]

Re: [ft] Scaline for rasterizer?

 From: Aya Koshigaya Subject: Re: [ft] Scaline for rasterizer? Date: Tue, 8 Sep 2009 11:44:48 +0200

```Hi,

```
okay.. so if I am right, to draw a line at a Y = 100, i'd give the rasterizer the value "100 << 6".. right? But as soon as I want a line at 100.453, I have to do some calculations to get the "453" speratated etc.. so, is there any easy to use FT-funktion for converting a float to the fixed float value?
```
Thanks,
Aya

On 08.09.2009, at 11:21, Mickey Gabel wrote:

```
```Aya Koshigaya wrote:
```
```Mhh ... okay, thanks :)
```
But how do I convert my value to a 26.6 float? And how do I store it in the rasterizer, since FT_POS is declared as "signed long".. not float..?
```Thanks,
Aya
```
```
```
Fixed-point arithmetic is not very complicated to understand. It's mostly regular integer math with a fixed scaling. You can start here: http://en.wikipedia.org/wiki/Fixed- point_arithmetic
```
```
FT2 has some very nice functions for using fixed-point. See http://www.freetype.org/freetype2/docs/reference/ft2-computations.html .
```

_______________________________________________
Freetype mailing list
```