package speiger.src.coreengine.rendering.gui.font.glyth;

import speiger.src.collections.ints.maps.impl.hash.Int2FloatOpenHashMap;
import speiger.src.collections.ints.maps.interfaces.Int2FloatMap;

public class GlythData {
	UnbakedGlyth data;
	Int2FloatMap kernings = new Int2FloatOpenHashMap();
	
	public GlythData(UnbakedGlyth data) {
		this.data = data;
	}
	
	public float advance() { return data.advance(); }
	public float shadowOffset() { return data.shadowOffset(); }
	public float kerning(int codepoint) { return kernings.computeFloatIfAbsent(codepoint, data::kerning); }
	public UnbakedGlyth unbaked() { return data; }
	public void cleanCache() { kernings.clear(); }
}
