IMG Home PageIMG ProductsProduct DownloadsOrdering InformationTechnical Support and Frequently Asked QuestionsDeveloper's Corner and UtilitiesAbout IMG
CustomersIMG ResellersMedia InformationIMG Events / Trade ShowsUseful LinksIMG Contact InformationIMG Information / Policies

IMG KnowledgeBase & Frequently Asked Questions

IMG Logo



Search FAQ's

Keyword Keyword Search Help
Category Type Product Version

Searching for ID: PU2023120982

PU2023120982
Working with Build-A-Board for a Linux Target, the font display on the Linux system does not match the selected font within the Build-A-Board builder

Unfortunately, there is no direct match for Windows fonts available in Build-A-Board and Linux based fonts. The following outlines some of the logic taken to interact with the X Server/Xlib font matching api functions. For background, the history of fonts in computers is a fascinating subject because of copyrights, character representations, and legal issues. In short, this is why this is an issue, especially on a free and open source platform such as Linux. The following approaches describe options to overcome these limitations.

The first option (if possible) is to expand the available fonts on your Linux system. There may be additional packages that can be installed to provide additional fonts. In general, the more fonts available, the more likely a match will be found based on your selected Window font. For example, on a Debian system adding the fonts-freefont-ttf package will add more fonts (e.g. apt install fonts-freefont-ttf as superuser, or use Synaptic). Another option might be to install the Adobe reader, as it will install Adobe fonts onto the system. Check with your distribution for other packages/font options.

The next option is to work with a limited set of font family names within Windows. The following font names will convert to a wild-card match within the X window font matching: 'Arial', 'Helv', 'helv', 'Times', 'Courier', 'Sans Serif'. For example, the Arial/Helvetica Windows source name will try to match *helv* on a Linux system. This does require that family of font names to be on the Linux system, but it increases the possibility that a match will be found. If no match is found, a default (and most likely undesirable) font will be displayed. There are also limitations to be aware of within the font matching approach. For practical purposes, your only options are regular, bold, italic, and bold italic. Also, only the height (point size) value is used - width is not used at all in the match attempt. See below for specific notes on the Build-A-Board font properties and how these limitations affect usable values.

If the above options do not help resolve the font display, another option is to specify the font name so a match can be achieved with the available fonts. In the Linux Developer's Kit, a fontlist utility has been added to list the internal list available through the XListFonts Xlib interface. With this list, the font name (face name), and be listed with wildcards (i.e. asterisks) to match an available font. The 2 most relevant items in the Linux font matching approach are the font face name, and the height. The fontlist utility lists the font info in the following form:
-FOUNDRY-FAMILY_NAME-WEIGHT_NAME-SLANT-SETWIDTH_NAME-ADD_STYLE_NAME-PIXEL_SIZE-POINT_SIZE-RESOLUTION_X-RESOLUTION_Y-SPACING-AVERAGE_WIDTH-CHARSET_REGISTRY-CHARSET_ENCODING (with the dash as the delimiter)
The Build-A-Board Face name matches the 2nd item (FAMILY_NAME), and the height value, which is associated with the POINT_SIZE. To best match, the actual height (absolute) value is multiplied by 10, then compared to available fonts, trying to match the highest value. The weight value is very limited. If greather than 700, the match will be 'bold' - otherwise, it will be 'medium'. The style flag is even more limited, in that to achieve the italic flag 'i', a Windows italic font must be selected - otherwise it is 'r' for regular. Refer to the images from Build-A-Board to match a Bitstream charter font for the entire board - as an example, if this was in your fontlist output:
-bitstream-charter-medium-r-normal--8-80-75-75-p-45-iso8859-1
-bitstream-charter-medium-r-normal--10-100-75-75-p-56-iso8859-1
-bitstream-charter-medium-r-normal--12-120-75-75-p-67-iso8859-1
-bitstream-charter-medium-r-normal--15-140-75-75-p-84-iso8859-1
-bitstream-charter-medium-r-normal--19-180-75-75-p-106-iso8859-1
-bitstream-charter-medium-r-normal--25-240-75-75-p-139-iso8859-1
-bitstream-charter-bold-i-normal--0-0-75-75-p-0-iso8859-1

You could specify the following in the board font properties to select the 24 point medium font:

Build-A-Board Board Properties / font setting button

Build-A-Board Board Properties / font settings dialog


The same approach can be used for a 'per key' font match - just use the name and height in the Key Properties.

Because testing on the target system is a required aspect to obtain the best match, an iterative approach is recommended. Because of the various limitations, understanding the above limitations are important to identify actual fonts on the system (fontlist dev kit utility), and entering the relevant name/height values in Build-A-Board, building the board, then testing with the KBF. Note that if Linux native names are used, the Windows based font display will be incorrect, and should be ignored.

Category: UsingType: Problem/Resolution Product: Build-A-BoardVersion: 2.20

Notes:



IMG Home PageIMG ProductsProduct DownloadsOrdering InformationTechnical Support and Frequently Asked QuestionsDeveloper's Corner and UtilitiesAbout IMG
CustomersIMG ResellersMedia InformationIMG Events / Trade ShowsUseful LinksIMG Contact InformationIMG Information / Policies


As seen in ...

Yahoo!finance