{
fd.setFontFamily( nr.getString() );
}
}
OS2WindowsMetricsTable os2 = ttf.getOS2Windows();
fd.setNonSymbolic( true );
switch( os2.getFamilyClass() )
{
case OS2WindowsMetricsTable.FAMILY_CLASS_SYMBOLIC:
fd.setSymbolic( true );
fd.setNonSymbolic( false );
break;
case OS2WindowsMetricsTable.FAMILY_CLASS_SCRIPTS:
fd.setScript( true );
break;
case OS2WindowsMetricsTable.FAMILY_CLASS_CLAREDON_SERIFS:
case OS2WindowsMetricsTable.FAMILY_CLASS_FREEFORM_SERIFS:
case OS2WindowsMetricsTable.FAMILY_CLASS_MODERN_SERIFS:
case OS2WindowsMetricsTable.FAMILY_CLASS_OLDSTYLE_SERIFS:
case OS2WindowsMetricsTable.FAMILY_CLASS_SLAB_SERIFS:
fd.setSerif( true );
break;
default:
//do nothing
}
switch( os2.getWidthClass() )
{
case OS2WindowsMetricsTable.WIDTH_CLASS_ULTRA_CONDENSED:
fd.setFontStretch( "UltraCondensed" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_EXTRA_CONDENSED:
fd.setFontStretch( "ExtraCondensed" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_CONDENSED:
fd.setFontStretch( "Condensed" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_SEMI_CONDENSED:
fd.setFontStretch( "SemiCondensed" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_MEDIUM:
fd.setFontStretch( "Normal" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_SEMI_EXPANDED:
fd.setFontStretch( "SemiExpanded" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_EXPANDED:
fd.setFontStretch( "Expanded" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_EXTRA_EXPANDED:
fd.setFontStretch( "ExtraExpanded" );
break;
case OS2WindowsMetricsTable.WIDTH_CLASS_ULTRA_EXPANDED:
fd.setFontStretch( "UltraExpanded" );
break;
default:
//do nothing
}
fd.setFontWeight( os2.getWeightClass() );
//todo retval.setFixedPitch
//todo retval.setNonSymbolic
//todo retval.setItalic
//todo retval.setAllCap