public int hashCode() { int result = fontFamily.hashCode(); result = 29 * result + ( bold ? 1 : 0 ); result = 29 * result + ( italics ? 1 : 0 ); return result; } }
public FontCache getSecondLevelCache() { return internalGetSecondLevelCache(); }
/** * Creates a new font metrics factory. That factory is specific to a certain font registry and is not required to * handle font records from foreign font registries. * <p/> * A font metrics factory should never be used on its own. It should be embedded into and used by a FontStorage * implementation. * * @return */ public FontMetricsFactory createMetricsFactory() { return new MonospaceFontMetricsFactory( lpi, cpi ); } }
public TextOutputProcessorMetaData( final float lpi, final float cpi ) { super( new DefaultFontStorage( new MonospaceFontRegistry( lpi, cpi ) ) ); setNumericFeatureValue( TextOutputProcessorMetaData.CHAR_WIDTH, 72.0 / cpi ); setNumericFeatureValue( TextOutputProcessorMetaData.CHAR_HEIGHT, 72.0 / lpi ); // the plain text target does not support arabic text at all. removeFeature( OutputProcessorFeature.COMPLEX_TEXT ); }
/** * Baselines are defined for scripts, not glyphs. A glyph carries script information most of the time (unless it is a * neutral characters or just weird). * * @param codePoint * @return */ public BaselineInfo getBaselines( final int codePoint, BaselineInfo info ) { if ( info == null ) { info = new BaselineInfo(); } info.setBaseline( BaselineInfo.HANGING, 0 ); info.setBaseline( BaselineInfo.MATHEMATICAL, charHeight / 2 ); info.setBaseline( BaselineInfo.CENTRAL, charHeight / 2 ); info.setBaseline( BaselineInfo.MIDDLE, charHeight / 2 ); info.setBaseline( BaselineInfo.ALPHABETIC, getMaxAscent() ); info.setBaseline( BaselineInfo.IDEOGRAPHIC, getMaxHeight() ); return info; }
public long getMaxAscent() { return getAscent(); }
public long getMaxDescent() { return getDescent(); }
public long getStrikeThroughPosition() { return (long) ( LibFontsDefaults.DEFAULT_STRIKETHROUGH_POSITION * getXHeight() ); }
/** * This selects the most suitable font in that family. Italics fonts are preferred over oblique fonts. * * @param bold * @param italics * @return */ public FontRecord getFontRecord( final boolean bold, final boolean italics ) { int index = 0; if ( bold ) { index += 1; } if ( italics ) { index += 2; } if ( fonts[ index ] != null ) { return fonts[ index ]; } fonts[ index ] = new MonospaceFontRecord( this, bold, italics ); return fonts[ index ]; }
public MonospaceFontRegistry( final float lpi, final float cpi ) { this.lpi = lpi; this.cpi = cpi; this.fontFamilies = new HashMap<String, MonospaceFontFamily>(); this.fallback = new MonospaceFontFamily( "Monospace", lpi, cpi ); }
public void add( final MonospaceFontFamily family ) { this.fontFamilies.put( family.getFamilyName(), family ); }
public long getOverlinePosition() { return getLeading() - Math.max( 1000, charHeight / 20 ); }
public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final MonospaceFontRecord that = (MonospaceFontRecord) o; if ( bold != that.bold ) { return false; } if ( italics != that.italics ) { return false; } if ( !fontFamily.equals( that.fontFamily ) ) { return false; } return true; }
public MonospaceFontMetricsFactory( final float lpi, final float cpi ) { this.metrics = new MonospaceFontMetrics( new DefaultFontNativeContext( false, false ), cpi, lpi ); }
public static LogicalPageBox layoutSingleBand( final MasterReport originalReport, final Band reportHeader, final boolean monospaced, final boolean expectPageBreak, final boolean designTime ) throws ReportProcessingException, ContentProcessingException { final FontStorage fontRegistry; if ( monospaced ) { fontRegistry = new DefaultFontStorage( new MonospaceFontRegistry( 9, 18 ) ); } else { fontRegistry = DebugOutputProcessorMetaData.getLocalFontStorage(); } return layoutSingleBand( originalReport, reportHeader, fontRegistry, expectPageBreak, designTime ); }
public long getUnderlinePosition() { return getAscent() + Math.max( 1000, charHeight / 20 ); }