Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.
Trekbuddy is on Github now

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
PNG picture fonts (bitmap fonts)

 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes
View previous topic :: View next topic  
Author Message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Thu Jan 28, 2016 12:40 pm    Post subject: PNG picture fonts (bitmap fonts) Reply with quote

Since I have to create quite many png picture fonts for my new CMS, I'm trying to understand the requirements (to limit unnecessary re-work) to ensure they work as expected.

I want to be able to use "day" and "night" modes, but I also want to be able to use anti-aliasing with transparency. (3rd in the attached picture below from https://en.wikipedia.org/wiki/Transparency_%28graphic%29)

Is this possible? If so, what type of png format is required? (Will a single colour picture with alpha-layer transparency work?)

I have been using PhotoFiltre 7 and Paint.NET and they seem to treat transparency a bit different, so that adds another layer of complication... Confused



Wikipedia.png
 Description:
From https://en.wikipedia.org/wiki/Transparency_%28graphic%29
 Filesize:  11.1 KB
 Viewed:  12783 Time(s)

Wikipedia.png


Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5673

PostPosted: Thu Jan 28, 2016 1:42 pm    Post subject: Reply with quote

Most bitmap fonts are single colour images with transparency.

Here is how GIMP displays it:



digi_in_gimp.png
 Description:
 Filesize:  12.33 KB
 Viewed:  12779 Time(s)

digi_in_gimp.png


Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Thu Jan 28, 2016 3:11 pm    Post subject: Reply with quote

Yes, exactly.

My own defined fonts, (2) in picture below, is single colour with transparency. And then day and night colour settings work.

System fonts, (1) in picture below, do have some alpha-channel transparency it seems, and it still works with day and night settings.

Own defined fonts that has more than one colour, (3) in pictures, pixels (even 1 colour plus alpha channel pixels) seem to keep their colour despite day or night settings.



alpha1.png
 Description:
 Filesize:  18.19 KB
 Viewed:  12774 Time(s)

alpha1.png



alpha2.png
 Description:
 Filesize:  38.44 KB
 Viewed:  12774 Time(s)

alpha2.png


Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5673

PostPosted: Thu Jan 28, 2016 4:46 pm    Post subject: Reply with quote

TB handles day/night color change in indexed color images (PNG color type 3). Could you send me the png file, I will have a look at it, thanks.
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Thu Jan 28, 2016 5:39 pm    Post subject: Reply with quote

kruch wrote:
TB handles day/night color change in indexed color images (PNG color type 3). Could you send me the png file, I will have a look at it, thanks.


So they must be "indexed" colour png files? I will have to investigate what exactly that means and if they can have an alpha channel or only a transparent colour. (I still know too little about this subject...)

I'm not sure which png file you want, but here are a few.



png.zip
 Description:
some png files

Download
 Filename:  png.zip
 Filesize:  110.9 KB
 Downloaded:  9 Time(s)

Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5673

PostPosted: Thu Jan 28, 2016 7:29 pm    Post subject: Reply with quote

You can try converting your truecolor with alpha font to palette-based using pngquant util (http://gnuwin32.sourceforge.net/downlinks/pngutils-bin-zip.php).

I tested converted bitmap with transparent antialised text (pngquant 256 input.png), and TB was able to modify the font color and preserve antialising/alpha channel.
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Fri Jan 29, 2016 7:02 am    Post subject: Reply with quote

kruch wrote:
... TB was able to modify the font color and preserve antialising/alpha channel.


This is great news! I will investigate this evening.

Thanks!
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Sat Jan 30, 2016 9:16 am    Post subject: Reply with quote

This works really well! And the files are quite a bit smaller, so loading them should be more efficient.

Before I start creating all the many png font files needed for all my arrows and pointers, I have to ask: what is the likelihood of getting the functionality to be able to rotate a png picture in Trekbuddy and display it at any specified angle? As discussed in post 9 of http://www.trekbuddy.net/forum/viewtopic.php?t=7676
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 556
Location: France

PostPosted: Sun Mar 27, 2016 9:50 am    Post subject: Reply with quote

Hello,

I have also problem to use "attached fonts .png" with day/night colors in CMS ...
I can make them working well with day/night colors in TB by using indexed colors mode settings in Gimp, but i lost antialiasing effects ... Sad

I try to use the convert tool (up) without success (i'm a bit lost with command lines and i dont know how to use it) Confused

Is someone able to convert my fonts, keeping antialiasing proprieties, and readable in TB with day/night colors builted with CMS creator ?

Thank you very much.



Fonts bw.zip
 Description:

Download
 Filename:  Fonts bw.zip
 Filesize:  19.52 KB
 Downloaded:  5 Time(s)

Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Sun Mar 27, 2016 5:22 pm    Post subject: Reply with quote

I would gladly convert the fonts for you, but I'm out traveling this week with no computer (only my nexus and my phone).

I did not use command-line tools. I used : https://nukesaq88.github.io/Pngyu/

(also see https://pngquant.org/)
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 556
Location: France

PostPosted: Sun Mar 27, 2016 5:45 pm    Post subject: Reply with quote

@JNT,
Thanks,

I try to use pngquant without success ... I think i miss something !
I'm not able to keep antialiasing effects of original .png with this tool.
I can use my fonts but it's less nice ... Confused


Edit : I speak too quickly because preview of the result have bad display in Gimp ... Wink

After using "pngquant", result in my phone with TB show very nice antialiasing fonts day/night. Very Happy
Thanks for all
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 415
Location: Sweden

PostPosted: Tue Apr 05, 2016 10:08 am    Post subject: Reply with quote

Here are your fonts, changed with Pngyu using my normal settings.


QuantFonts.zip
 Description:
Fonts changed to use Day/Night colours

Download
 Filename:  QuantFonts.zip
 Filesize:  8.16 KB
 Downloaded:  7 Time(s)

Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 556
Location: France

PostPosted: Tue Apr 05, 2016 11:11 am    Post subject: Reply with quote

Hi JNT,
I found how to do just before you post, but thanks for sharing ... could be a good help for more users. Smile
Back to top
View user's profile Send private message
Lamin06



Joined: 26 Nov 2017
Posts: 1

PostPosted: Sun Nov 26, 2017 8:36 pm    Post subject: Re: PNG picture fonts (bitmap fonts) Reply with quote

JNT wrote:
Since I have to create quite many png picture fonts for my new CMS, I'm trying to understand the requirements (to limit unnecessary re-work) to ensure they work as expected.

I want to be able to use "day" and "night" modes, but I also want to be able to use anti-aliasing with transparency. (3rd in the attached picture below from https://en.wikipedia.org/wiki/Transparency_%28graphic%29) obtenir prêt

Is this possible? If so, what type of png format is required? (Will a single colour picture with alpha-layer transparency work?)

I have been using PhotoFiltre 7 and Paint.NET and they seem to treat transparency a bit different, so that adds another layer of complication... Confused

Hello, thank you for sharing this information
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group