What I've been upto recently is designing for the very first time an un-proportional Bitmap Font.
In lamens terms images with different sizes set out in a grid to be split up for drawing to the screen.
What I am trying to put into place, is a routine that works out the start X position as an offset to be dealt with in the drawing routine.
The tiles of letter images are centered in each one based on the width, im having difficulties in working out the offsets, if there's black say on the first 4-5 lines it needs to ignore these ( it'll be different for each image tile ), plus it needs to know the shortest amount of empty / black pixels before a solid colour is reached for the OffsetX( LetterNo ) to be exact.
I'm also wondering if i need to put offsets for both the left justified and the right justified?
I am very sorry too my font is a 3rd from complete, so if you'd be so kind, can you imagine the font when thinking up a master plan.
the code is Freebasic orientated, i put it in here on the off chance someone with a different language has done similar.
Dim As Integer OffsetX( TilesAcross*TilesDown )
Sub Offsetter( ByVal WWidth, ByVal Height)
Dim as integer x,y
Dim As UInteger col
Dim As Integer FrameNum
For FrameNum=1 to TotalTiles-1 // Start at 1 as in ascii Tile at 0 is used for space.
for y=0 to Height-1
for x=0 to WWidth-1
Col=ImageTileBank[x+y*WWidth ]
If Col= 0 Then
OffsetX(FrameNum)+=1
Else
OffsetX(FrameNum)=OffsetX(FrameNum)
End If
next
next
next
End Sub
Thanks and have a great day,
Clyde.



