public virtual pspCharInfo getCharInfo(int charCode, int glyphType) { pspCharInfo charInfo = new pspCharInfo(); Glyph glyph = getCharGlyph(charCode, glyphType); if (glyph == null) { // For a character not present in the font, return pspCharInfo with all fields set to 0. // Confirmed on a PSP. return(charInfo); } charInfo.bitmapWidth = glyph.w; charInfo.bitmapHeight = glyph.h; charInfo.bitmapLeft = glyph.left; charInfo.bitmapTop = glyph.top; charInfo.sfp26Width = glyph.dimensionWidth; charInfo.sfp26Height = glyph.dimensionHeight; // TODO Test if the Ascender and Descender values are now matching the PSP charInfo.sfp26Ascender = glyph.yAdjustH; charInfo.sfp26Descender = charInfo.sfp26Ascender - charInfo.sfp26Height; charInfo.sfp26BearingHX = glyph.xAdjustH; charInfo.sfp26BearingHY = glyph.yAdjustH; charInfo.sfp26BearingVX = glyph.xAdjustV; charInfo.sfp26BearingVY = glyph.yAdjustV; charInfo.sfp26AdvanceH = glyph.advanceH; charInfo.sfp26AdvanceV = glyph.advanceV; if (glyphType == FONT_PGF_GLYPH_TYPE_SHADOW) { int scaleX = 64 / shadowScaleX; int scaleY = 64 / shadowScaleY; charInfo.bitmapWidth *= scaleX; charInfo.bitmapHeight *= scaleY; charInfo.bitmapLeft *= scaleX; charInfo.bitmapTop *= scaleY; charInfo.sfp26Ascender *= scaleY; charInfo.sfp26Descender *= scaleY; } return(charInfo); }
public override pspCharInfo getCharInfo(int charCode, int glyphType) { pspCharInfo charInfo = new pspCharInfo(); if (glyphType != FONT_PGF_GLYPH_TYPE_CHAR) { return(charInfo); } charInfo.bitmapWidth = charBitmapWidth; charInfo.bitmapHeight = charBitmapHeight + 1; charInfo.sfp26Width = charBitmapWidth << 6; charInfo.sfp26Height = (charBitmapHeight + 1) << 6; charInfo.sfp26Ascender = charBitmapHeight << 6; charInfo.sfp26BearingHY = charBitmapHeight << 6; charInfo.sfp26BearingVX = -480; // -7.5 charInfo.sfp26AdvanceH = (charBitmapWidth + 1) << 6; charInfo.sfp26AdvanceV = (charBitmapHeight + 2) << 6; return(charInfo); }