protected void updateStyle ( BoxStyle bstyle , TextPosition text ) { String font = text . getFont ( ) . getName ( ) ; String family = null ; String weight = null ; String fstyle = null ; bstyle . setFontSize ( text . getFontSizeInPt ( ) ) ; bstyle . setLineHeight ( text . getHeight ( ) ) ; if ( font != null ) { //font style and weight for ( int i = 0 ; i < pdFontType . length ; i ++ ) { if ( font . toLowerCase ( ) . lastIndexOf ( pdFontType [ i ] ) >= 0 ) { weight = cssFontWeight [ i ] ; fstyle = cssFontStyle [ i ] ; break ; } } if ( weight != null ) bstyle . setFontWeight ( weight ) ; else bstyle . setFontWeight ( cssFontWeight [ 0 ] ) ; if ( fstyle != null ) bstyle . setFontStyle ( fstyle ) ; else bstyle . setFontStyle ( cssFontStyle [ 0 ] ) ; //font family //If it's a known common font don't embed in html output to save space String knownFontFamily = findKnownFontFamily ( font ) ; if ( ! knownFontFamily . equals ( "" ) ) family = knownFontFamily ; else { family = fontTable . getUsedName ( text . getFont ( ) ) ; if ( family == null ) family = font ; } if ( family != null ) bstyle . setFontFamily ( family ) ; } updateStyleForRenderingMode ( ) ; }
Updates the text style according to a new text position