473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Convert Font into .C

11
Hi all,

I've have a GUI which calls a the following source file when I need to assign any font to be used in the GUI:
static unsigned char
bitmaps[]={
1, 10, 4, // 0x20
0x00, //

9, 2, 4, // 0x21 '!'
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x40, // #
0x00, //
0x60, // ##
0x60, // ##

3, 2, 5, // 0x22 '"'
0x50, // # #
0x50, // # #
0x50, // # #

8, 3, 8, // 0x23 '#'
0x14, // # #
0x14, // # #
0x7E, // ######
0x28, // # #
0x28, // # #
0xFC, // ######
0x50, // # #
0x50, // # #

11, 2, 7, // 0x24 '$'
0x10, // #
0x78, // ####
0xD4, // ## # #
0xD0, // ## #
0x78, // ####
0x1C, // ###
0x94, // # # #
0xD4, // ## # #
0x78, // ####
0x10, // #
0x10, // #
.................................................. ...............

Could anyone provide some help for me to convert fonts into this form of .c file? I need to use larger size fonts and the available fonts are only in size 12.

Thanks!

Regards
TKM
Mar 24 '08 #1
1 2711
TKM
11
Following is a more detailed program, please provide help on how to go about converting a font into such .c file:

#include "../include/ewin.h"

static unsigned char
bitmaps[]={
1, 10, 4, // 0x20
0x00, //

9, 2, 4, // 0x21 '!'
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x40, // #
0x00, //
0x60, // ##
0x60, // ##

3, 2, 5, // 0x22 '"'
0x50, // # #
0x50, // # #
0x50, // # #

8, 3, 8, // 0x23 '#'
0x14, // # #
0x14, // # #
0x7E, // ######
0x28, // # #
0x28, // # #
0xFC, // ######
0x50, // # #
0x50, // # #

11, 2, 7, // 0x24 '$'
0x10, // #
0x78, // ####
0xD4, // ## # #
0xD0, // ## #
0x78, // ####
0x1C, // ###
0x94, // # # #
0xD4, // ## # #
0x78, // ####
0x10, // #
0x10, // #

9, 2, 12, // 0x25 '%'
0x71, 0x00, // ### #
0xDB, 0x00, // ## ## ##
0xDA, 0x00, // ## ## #
0x74, 0x00, // ### #
0x04, 0x00, // #
0x09, 0xC0, // # ###
0x0B, 0x60, // # ## ##
0x1B, 0x60, // ## ## ##
0x11, 0xC0, // # ###

9, 2, 9, // 0x26 '&'
0x38, 0x00, // ###
0x6C, 0x00, // ## ##
0x6C, 0x00, // ## ##
0x38, 0x00, // ###
0x79, 0x00, // #### #
0xCF, 0x00, // ## ####
0xC6, 0x00, // ## ##
0xCF, 0x00, // ## ####
0x79, 0x80, // #### ##

3, 2, 4, // 0x27 '''
0x60, // ##
0x20, // #
0x40, // #

12, 2, 6, // 0x28 '('
0x18, // ##
0x30, // ##
0x30, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x60, // ##
0x30, // ##
0x30, // ##
0x18, // ##

12, 2, 6, // 0x29 ')'
0x60, // ##
0x30, // ##
0x30, // ##
0x18, // ##
0x18, // ##
0x18, // ##
0x18, // ##
0x18, // ##
0x18, // ##
0x30, // ##
0x30, // ##
0x60, // ##

4, 2, 6, // 0x2A '*'
0x20, // #
0xF8, // #####
0x70, // ###
0x50, // # #

5, 5, 7, // 0x2B '+'
0x30, // ##
0x30, // ##
0xFC, // ######
0x30, // ##
0x30, // ##

4, 9, 4, // 0x2C ','
0x60, // ##
0x60, // ##
0x20, // #
0x40, // #

1, 7, 8, // 0x2D '-'
0x7C, // #####

2, 9, 4, // 0x2E '.'
0x60, // ##
0x60, // ##

9, 2, 4, // 0x2F '/'
0x30, // ##
0x30, // ##
0x20, // #
0x60, // ##
0x60, // ##
0x40, // #
0x40, // #
0xC0, // ##
0xC0, // ##

...

12, 2, 8, // 0xFF ''
0x6C, // ## ##
0x00, //
0xC6, // ## ##
0xC6, // ## ##
0x6C, // ## ##
0x6C, // ## ##
0x38, // ###
0x38, // ###
0x18, // ##
0x10, // #
0x30, // ##
0x60 }; // ##

FontDef
helvB12.pcf={
14, // Nominal height
224, // Number of characters
bitmaps }; // Bitmap data
Mar 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Red Devil | last post by:
I have a class containing string variables, hashtables..I managed to serialize it into a memory stream instead of file stream. Would like to know how can I convert the byte array to string. I tried...
3
by: Wim | last post by:
I would like to store the ListView font in the XML config file. So I have a string variable listFont that stores the font (font.ToString()). It must be a string variable because a Font object...
2
by: Harry | last post by:
how to convert <font/> tab in .NET framework? e.g. if i want to write the follow html in code behind, what i can do? <font class="css">cell 1</font>
19
by: jcrouse | last post by:
I decided to start a new thread. I have output in xml file format. It looks like this: <P1JoyUp> <Top>326</Top> <Left>54</Left> <Height>23</Height> <Width>100</Width> <Visible>True</Visible>...
1
by: Jorge | last post by:
I want to convert this xml to pdf using cocoon <?xml version="1.0" encoding="ISO-8859-1" ?> <document> <header> <title>Pagina</title> </header> <body> <h1>Link dei siti pił visitati da...
4
by: andy.mcvicker | last post by:
Hi Gang I'm not sure what needs to be changed when converting an asp to vbs. I'm not sure if I can with my code below. Can someone PLEASE convert the text below to vbs? Thanks a million....
0
by: iwdu15 | last post by:
hi, im trying to convert RTF font size to an HTML font size so theyl look the same in a richtextbox control and a webbrowser control, yet i cant seem to get it right, i kno the sizes are measured...
1
by: priyakollu | last post by:
i have developed code in jsp but the problem is i need to convert this to asp.........pleasehelp me regarding this im sending code which i've developed....with file names.......... code.jsp <%@...
5
by: stef | last post by:
hello I can find all kind of procedures to convert an array to a bitmap (wxPython, PIL), but I can't find the reverse, either - convert a bitmap to an array or - read a bitmap file to an...
1
by: akress | last post by:
Hiya, I'm trying to convert a table with 6 colums that looks like this: <table class="myTable" width="640px"> <tr> <td><a href="#"> <img src="../_img/announce.gif" align="middle"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.