Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Proportional Fonts for GLCDs + TrueType Converter
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Thu Nov 06, 2014 11:37 pm    Post subject: Proportional Fonts for GLCDs + TrueType Converter Reply with quote

Hi,

I started this project some weeks ago, when EDC posted his Font Converter one week later I was like Rolling Eyes (can happen, he did a great work Wink ), but anyways, here it is:





Features:
Font Converter
- Exports installed TrueType fonts
- Set size, character spacing, text styles, reduced charsets
- Automatically uses RLE-compression if beneficial
- Automatic updates, Stand-alone application

Font Library
- Loads font data
- Draws strings with selected font (colored)
- Width of text with selected font

More informations & download: http://mat.midlight.eu/wiki/index.php/Bascom_Proportional_Fonts

Best regards

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4958
Location: Holland

blank.gif
PostPosted: Fri Nov 07, 2014 12:09 am    Post subject: Reply with quote

wow, how cool ! looks great. Thanks for sharing.
_________________
Mark
Back to top
View user's profile Visit poster's website
djalltra

Bascom Member



Joined: 23 Oct 2014
Posts: 28

PostPosted: Sat Nov 08, 2014 10:53 am    Post subject: Reply with quote

hi there seems to be a problem with the download link
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Sat Nov 08, 2014 1:56 pm    Post subject: Reply with quote

Hi,

I am sorry, but I can't find any problem? The download link works for me (http://www.braunecker.at/downloads/fontconverter/ProportionalFonts.zip), the archive seems to be ok and the extracted application executes.
Whats happening?

Best regards

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Nov 08, 2014 2:58 pm    Post subject: It is working... Reply with quote

Works for me.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2103

netherlands.gif
PostPosted: Sat Nov 08, 2014 8:06 pm    Post subject: Reply with quote

Very nice, thanks for sharing.
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Mon Apr 20, 2015 8:59 pm    Post subject: Reply with quote

Update 1.1
FontConverter:
- Export corresponding Bascom Library
- Save font in binary file

Library:
- Lcd_tt_loadfont(): removed bylabel call, use Restore [Fontlabel] before calling Lcd_tt_loadfont()
- Proper handling of RAMPZ register for devices with more than 64K flash memory
- ~30% speed increase

br

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2103

netherlands.gif
PostPosted: Mon Apr 20, 2015 10:01 pm    Post subject: Reply with quote

Very nice, thanks for sharing again.
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4958
Location: Holland

blank.gif
PostPosted: Mon Apr 20, 2015 10:32 pm    Post subject: Reply with quote

Thanks for the update. The TT fonts look great.
_________________
Mark
Back to top
View user's profile Visit poster's website
cucuruzel

Bascom Member



Joined: 18 Mar 2010
Posts: 52
Location: Cluj-Napoca

romania.gif
PostPosted: Mon Feb 06, 2017 4:43 pm    Post subject: Reply with quote

Hello
I have tested your code, great work! Thanks

It seems there are two bugs:

1. the Lcd_tt_textwidth function returns strange results, if local X is not initialized.
I have fixed with:
Code:
   Local X As Word
   X = 0
 

From bascom help:
Quote:
Notice that a LOCAL variable is not initialized. It will contain a value that will depend on the value of the FRAME data. So you can not assume the variable is 0. If you like it to be 0, you need to assign it.


2. FontConverter.exe does not restore correctly after minimize.
Steps to reproduce:
1. Open FontConverter.exe
2. Minimize window
3. restore window from Task Bar

It would be really nice if there was some sort of font editor to tweak some chars after resize.

Windows 10 x64
Bascom version: 2.0.7.9
Back to top
View user's profile Visit poster's website Yahoo Messenger
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Sun Feb 12, 2017 4:42 pm    Post subject: Reply with quote

Hello,

thank you for the feedback, fixed the bugs and will deploy it with the next version.

I like the idea of being able to edit the font, I'll see what I can come up with!

Best regards

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Mon Feb 27, 2017 6:58 pm    Post subject: Reply with quote

Update 1.2
FontConverter:

- Added a character editor to modify the generated pixel font
- Added .inc font import
- Added pixel conversion threshold for font generation
- Fixed wrong arranged GUI elements when minizing
- Proper handling of underlined fonts
- Removed "Set charset" button
- minor bug fixes

Library:

- updated for Bascom 2.0.8.0
- Lcd_tt_text(): fixed R0 could contain wrong values when the font uses RLE compression, leading to corrupted text after the first character
- Lcd_tt_textwidth(): proper local variable initialisation

br

_________________
LCD Menu | Proportional Fonts
Back to top
View user's profile Visit poster's website
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 52

poland.gif
PostPosted: Sat Sep 16, 2017 8:01 pm    Post subject: Reply with quote

Hello

I have problem with tt_fonts , ProportionalFont.inc library 1.2
I use xmega128 and fonts Timesnewroman_10pt and demo ILI9341-Sample.bas
when I use
Code:
Lcd_tt_text "0" , 1 , 10 , Color
then display show 03 ,
when
Code:
Lcd_tt_text "1" , 1 , 10 , Color
thendisplay shows 13
when
Code:
Lcd_tt_text "Hello" , 1 , 10 , Color
thendisplay shows H33333, always shows only first letter and number

where is problem ?

I noticed that result on display depend of $framesize , but always is incorrect

Thanks
Bob
Back to top
View user's profile
Netzman

Bascom Expert



Joined: 25 Nov 2005
Posts: 111
Location: Graz

austria.gif
PostPosted: Mon Nov 06, 2017 11:36 pm    Post subject: Reply with quote

Hello,

finally found the culprit, again it was RAMPZ getting corrupted (only happened to me when I was not using XRAM).
I updated the wiki download, existing versions should get an update notification.

Update 1.3
Library:
- fixed RAMPZ getting corrupted when not using XRAM, printing only the first character.

br

_________________
LCD Menu | Proportional Fonts


Last edited by Netzman on Tue Nov 14, 2017 7:51 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 663

poland.gif
PostPosted: Mon Nov 13, 2017 6:39 pm    Post subject: Reply with quote

I was try your library for the first time.
Download on the your Wiki side for 1.3version not work for me .
..but 1.2version was updated only for libary, maybe this is the catch Very Happy
I dont receive any update info after download and run 1.2 (this is only info data)

Im very impressed your work and want to confirm one thing for the Other Users: "If you have routine in your programm that can Set the pixel then you can use those libs/programm"

My one change it was use my routine for this particullar TFT. You must find It in the INC file but maybe PUSH`s and POP`s may must be tested Very Happy
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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