pcb-rnd knowledge pool

 

Alien format: text test cases

alien_text by Tibor 'Igor2' Palinkas on 2020-05-17

Tags: howto, text, test, input, alien, file, format

node source

 

 

Abstract: This article describes a series of proper test cases that provides the easier way for completly reverse engineering and testing support for text loaded from an alien format.

 

t_base.*: base/alignment

The base test case demonstrates text alignment and scaling. It has the same text string: M_AWjgi.,Q_Tx_M . The character 'x', is replaced with an unique digit or letter, so each text has an identifier in its string that makes it easier to find it in the file and on the screen.

It is important to use this exact test string: it is designed so that properties of the input font can be determined: M is traditionally the base height of the font (the 'em' unit), A and W should be wide characters while j and i are normally narrower - unless the font uses fixed width characters. j and g helps determining if there is base-lining. Punctuation . and , helps detecting if anything unusual is done to punctuation. The center of the string will be somewhere between i and Q normally; Q provides a good reference point for "pixel counting". The unique identifier, _Tx_ helps matching up strings between screen and file. The final M helps determining the right side of the bounding box.

Whenever a text object is placed, the placement reference point, the exact coord that ends up in the file, must be marked with two perpendicular lines in an "L" shape, with the common point being exactly at the location the file has for the text object coordinate. This is often done by creating the text objects (with the proper alignment, see below) in the GUI then saving the file, reading out the coordinates for each text and drawing the "L" marks. It's extremely important that the "L" mark is numerically at the coordinate where the text is placed - do not manually place or move it on the GUI for any of the test cases!

Make sure the "L" mark is as thin as possible so finding the corner is easier.

Each test file must be:

The base/alignment test file contains the following text objects:

Leave plenty of room between the text objects. Ideally text objects should be in a vertical row with at least 4..6x the height of the text object left empty between two text object.

Here is an example in BXL format . You can load it in pcb-rnd and/or use bxl2txt from util/ to convert it to text.

t_scale.*: Scaling

Pick the default text alignment, place a text with the original size with text ID 0 (so the text string is M_AWjgi.,Q_T0_M ), with the L marker drawn. Then, depending on the features of the EDA system:

t_base_rot.* and t_scale_rot.*: rotation

Take t_base.* and t_scale.* and rotate every text by 20 degrees. Do this by editing the file and not by using the GUI. This is important: we want the same coordinates and the same L marks in the resulting files.

Once the file is edited, run the software to make the export.

t_base_mirx.* and t_scale_mirx.*: x mirror

Take t_base.* and t_scale.* and apply X mirror on each text. X mirror is when the X coordinates are affected by the Y coordinates are not. That is, mirroring over the Y axis. Do this by editing the file and not by using the GUI. This is important: we want the same coordinates and the same L marks in the resulting files.

Once the file is edited, run the software to make the export.

If the software/format doesn't support x mirroring, skip this test case.

t_base_miry.* and t_scale_miry.*: y mirror

Take t_base.* and t_scale.* and apply Y mirror on each text. Y mirror is when the Y coordinates are affected by the X coordinates are not. That is, mirroring over the X axis. Do this by editing the file and not by using the GUI. This is important: we want the same coordinates and the same L marks in the resulting files.

Once the file is edited, run the software to make the export.

If the software/format doesn't support y mirroring, skip this test case.

t_base_rotmir.*: rotation+mirror

Take t_baserot.* and apply X or Y mirror on each text. Apply only one of the mirrors and apply the same one on all text objects. Do this by editing the file and not by using the GUI. This is important: we want the same coordinates and the same L marks in the resulting files.

Once the file is edited, run the software to make the export.

If the software/format doesn't support x mirroring, skip this test case.