File size: 925 Bytes
d46f4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.mojang.blaze3d.font;

import java.util.function.Function;
import net.minecraft.client.gui.font.glyphs.BakedGlyph;
import net.minecraft.client.gui.font.glyphs.EmptyGlyph;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public interface GlyphInfo {
    float getAdvance();

    default float getAdvance(boolean p_83828_) {
        return this.getAdvance() + (p_83828_ ? this.getBoldOffset() : 0.0F);
    }

    default float getBoldOffset() {
        return 1.0F;
    }

    default float getShadowOffset() {
        return 1.0F;
    }

    BakedGlyph bake(Function<SheetGlyphInfo, BakedGlyph> p_231088_);

    @OnlyIn(Dist.CLIENT)
    public interface SpaceGlyphInfo extends GlyphInfo {
        @Override
        default BakedGlyph bake(Function<SheetGlyphInfo, BakedGlyph> p_231090_) {
            return EmptyGlyph.INSTANCE;
        }
    }
}