Using custom bitmaps for text

Help and techniques for creating Air Manager Instrument Graphics

Moderators: russ, Ralph

Post Reply
Message
Author
frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Using custom bitmaps for text

#1 Post by frumpy »

Hi guys,

I am thinking about doing a CDU. I'll get a string like "PROGRESS" and want to assign a little bitmap
for "P", "R" and so on. I found a similar true type font, but I feel it's harder to change than a given
graphic.

Is there an easy (or at least decent) way to do this? I think I might read the string character by
character, write it to an array and then display the bitmaps by reading out the array. Has
anyone ever done that or even know an easier way?

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Using custom bitmaps for text

#2 Post by Ralph »

I probably don't really understand your explanation, but why wouldn't you just want to use text?

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Using custom bitmaps for text

#3 Post by Sling »

Like Ralph said why not use text its much much easier. I'd spend my time searching for the right font or even creating your own font. Using images in place of text in lots of places displaying lots of different words is going to end with an elaborate solution.

That said i have used images to replicate text or digits before but only in select cases and for just a few specific characters.

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#4 Post by frumpy »

I'd like to replicate the B737 CDU font:

http://www.b737.org.uk/images/fmc_refnavdata_runway.gif

The best I could find was BoeingCDU-Large.ttf, but it differs in some way.
I checked out a font creator (High-Logic Font Creator), but just to remove
a simple serif took minutes and was not really intuitive.

Perhaps I should check for other font editors then.

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Using custom bitmaps for text

#5 Post by Ralph »

What about this font?
glassga.zip
(28.51 KiB) Downloaded 265 times

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#6 Post by frumpy »

Well, that's a thumps up! :) Thanks.

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Using custom bitmaps for text

#7 Post by Ralph »

Stole it from the FSX folder ;)

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#8 Post by frumpy »

Hmm, I cannot get any text to display? I tried the screencast, but that didn't help.
I tried this code from the API and put glassga.ttf in the /ressources folder.

Code: Select all

mytext1 = txt_add("hello world", "font:glassga.ttf; size:11; color: black; halign:right;", 0, 0, 800, 200)

-- rename text
txt_set(mytext1, "goodbye world")

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: Using custom bitmaps for text

#9 Post by Corjan »

Hey,


Note that you create a text box that is 800 pixels wide, and you ask AM to align the text all the way to the right of that box.
Might it be that your instrument is not 800 pixels wide and that the text is rendered outside of the instrument bounds?


Corjan

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#10 Post by frumpy »

Thanks, a "100, 100" did it. I have to look more into what the box does.

Post Reply