Using custom bitmaps for text

Help and techniques for creating Air Manager Instrument Graphics

Moderators: Ralph, russ

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

Using custom bitmaps for text

#1 Post by frumpy » Mon Mar 19, 2018 9:05 pm

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: 5103
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Using custom bitmaps for text

#2 Post by Ralph » Tue Mar 20, 2018 8:42 am

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

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

Re: Using custom bitmaps for text

#3 Post by Sling » Tue Mar 20, 2018 9:22 am

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: 237
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#4 Post by frumpy » Tue Mar 20, 2018 10:29 am

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: 5103
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Using custom bitmaps for text

#5 Post by Ralph » Tue Mar 20, 2018 11:28 am

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

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

Re: Using custom bitmaps for text

#6 Post by frumpy » Tue Mar 20, 2018 11:38 am

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

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

Re: Using custom bitmaps for text

#7 Post by Ralph » Tue Mar 20, 2018 12:06 pm

Stole it from the FSX folder ;)

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

Re: Using custom bitmaps for text

#8 Post by frumpy » Tue Mar 20, 2018 7:01 pm

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: 2371
Joined: Thu Nov 19, 2015 9:04 am

Re: Using custom bitmaps for text

#9 Post by Corjan » Tue Mar 20, 2018 7:34 pm

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: 237
Joined: Sat Jan 30, 2016 12:01 pm

Re: Using custom bitmaps for text

#10 Post by frumpy » Tue Mar 20, 2018 7:47 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest