2.4.109 Fbi

The Fbi record specifies the font information at the time the scalable font is added to the chart.<84>

If the scaled font size matches the font size of the Font record (as specified by ifnt and Font.dyHeight), then that Font record is used to render the scaled fonts. If the scaled font size doesn't match the size of the Font record (as specified by ifnt), then a new Font record is added to the font table and the following font scaling algorithm is used to determine the scaled font size:

  1. Start with the current chart area in dots or pixels at 96 DPI. Convert this size to Twips by multiplying width and height by 1440 Twips per inch / 96 dots per inch. Call this dmix and dmiy respectively.

  2. If the scale basis scab is plot area, then apply the plot area scaling factors PlotGrowth.dxPlotGrowth/65536 and PlotGrowth.dyPlotGrowth/65536 to dmix and dmiy respectively. 

  3.  Determine the scaled height basis by multiplying twpHeightBasis by dmix / dmixBasis; name this twpX.

  4. Multiply twpHeightBasis by dmiy / dmiyBasis; call this twpY.

  5. Take the smaller of twpX and twpY and name this twpNew.  If this value is less than 10, set it equal to 10.

  6. Round this value to the nearest quarter point.

  7. If the value of twpHeightBasis is between 160 (inclusive) and 240 (inclusive), and the value of twpNew is between 120 (inclusive) and 160, make twpNew equal to 160. If the value of Fbi.twpHeightBasis is between 160 (inclusive) and 240 (inclusive), and value of twpNew is between 240 and 280 (inclusive), make twpNew equal to 240.

  8. twpNew is the new scaled font size. If the dyHeight field of the Font record (as specified by Fbi.ifnt) is the same as the value of twpNew, then load that Font record for the scaled font. If it isn't the same, twpNew is the new scaled font size and a new Font record is added to the font table.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

dmixBasis

dmiyBasis

twpHeightBasis

scab

ifnt

dmixBasis (2 bytes): An unsigned integer that specifies the font width, in twips, when the font was first applied. MUST be greater than or equal to 0 and less than or equal to 0x7FFF.

dmiyBasis (2 bytes): An unsigned integer that specifies the font height, in twips, when the font was first applied. MUST be greater than or equal to 0 and less than or equal to 0x7FFF.

twpHeightBasis (2 bytes):  An unsigned integer that specifies the default font height in twips. MUST be greater than or equal to 20 and less than or equal to 8180.

scab (2 bytes):  A Boolean (section 2.5.14) that specifies the scale to use. The value MUST be one of the following values:

Value

Meaning

0x0000

Scale by chart area

0x0001

Scale by plot area

 

ifnt (2 bytes): A FontIndex structure that specifies the font. MUST be used when ifnt is less than or equal to 255.