mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 05:27:37 +00:00
FONT SO PRETTY IT GOT ME ACTING FONTOSEXUAL
This commit is contained in:
1 parent
28d7b02350
commit
71f0ee1973
1 file changed
+10
-1
@@ -77,6 +77,15 @@ public class GlyphCache {
|
||||
*/
|
||||
private static final int GLYPH_PADDING = 2;
|
||||
|
||||
/**
|
||||
* Spacing (in pixels) inserted between adjacent glyphs in the temporary string image during rasterization.
|
||||
* Each glyph is shifted right by GLYPH_SPACING * glyphIndex to prevent kerning from merging adjacent glyphs.
|
||||
* This must be >= 2 * GLYPH_PADDING + 1 so that when padded bounding boxes are extracted for adjacent glyphs,
|
||||
* they never overlap. Without sufficient spacing, bold/italic glyphs (which have wider ink bounds) can bleed
|
||||
* fragments of neighbouring glyphs into each other's cached texture regions.
|
||||
*/
|
||||
private static final int GLYPH_SPACING = 2 * GLYPH_PADDING + 1;
|
||||
|
||||
/**
|
||||
* Transparent (alpha zero) white background color for use with BufferedImage.clearRect().
|
||||
*/
|
||||
@@ -506,7 +515,7 @@ public class GlyphCache {
|
||||
*/
|
||||
for (int i = 0; i < numGlyphs; i++) {
|
||||
Point2D pos = vector.getGlyphPosition(i);
|
||||
pos.setLocation(pos.getX() + 2 * i, pos.getY());
|
||||
pos.setLocation(pos.getX() + GLYPH_SPACING * i, pos.getY());
|
||||
vector.setGlyphPosition(i, pos);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user