Pixel-vector optimising for lisp-font?
Posted: Sat Nov 28, 2009 6:48 pm
				
				I am thinking about a converter from bitmaps fonts to a lisp-format describing the needed Pixelgrid
Example letter bitmap 7 x 15 (zoomed):

I scan the bitmap vertical and horzontal and get 2 vector lists.
So I want to draw the pixels with the vectors with the largest length and want to avoid double vectors.
Any lispish ideas?
			Example letter bitmap 7 x 15 (zoomed):

I scan the bitmap vertical and horzontal and get 2 vector lists.
Code: Select all
Bitmap: 7 x 15 Pixel
Vertical scan:
;     X1 Y1 X2 Y2       Length
(list  0 10  0 11)      ;2
(list  1  7  1  9)      ;3
(list  2  1  2  1)      ;1
(list  2  4  2  6)      ;3
(list  2  8  2  8)      ;1
(list  3  3  3  3)      ;1
(list  3  8  3  8)      ;1
(list  4  1  4  1)      ;1
(list  4  4  4  6)      ;3
(list  4  8  4  8)      ;1
(list  5  7  5  9)      ;3
(list  6 10  6 11)      ;2
Horizontal scan:
;     X1 Y1 X2 Y2       Length
(list  2  1  2  1)      ;1
(list  4  1  4  1)      ;1
(list  3  3  3  3)      ;1
(list  2  4  2  4)      ;1
(list  4  4  4  4)      ;1
(list  2  5  2  5)      ;1
(list  4  5  4  5)      ;1
(list  2  6  2  6)      ;1
(list  4  6  4  6)      ;1
(list  1  7  1  7)      ;1
(list  5  7  5  7)      ;1
(list  1  8  5  8)      ;5
(list  1  9  1  9)      ;1
(list  5  9  5  9)      ;1
(list  0 10  0 10)      ;1
(list  6 10  6 10)      ;1
(list  0 11  0 11)      ;1
(list  6 11  6 11)      ;1
Code: Select all
Wanted Result:
(list  0 10  0 11)      ;2
(list  1  7  1  9)      ;3
(list  2  1  2  1)      ;1
(list  2  4  2  6)      ;3
(list  3  3  3  3)      ;1
(list  4  1  4  1)      ;1
(list  4  4  4  6)      ;3
(list  5  7  5  9)      ;3
(list  6 10  6 11)      ;2
(list  1  8  5  8)      ;5