package font

type glyphExtents struct {
	valid   bool
	extents GlyphExtents
}

type extentsCache []glyphExtents

func ( extentsCache) ( GID) (GlyphExtents, bool) {
	if int() >= len() {
		return GlyphExtents{}, false
	}
	 := []
	return .extents, .valid
}

func ( extentsCache) ( GID,  GlyphExtents) {
	if int() >= len() {
		return
	}
	[].valid = true
	[].extents = 
}

func ( extentsCache) () {
	for  := range  {
		[] = glyphExtents{}
	}
}

func ( *Face) ( GID) (GlyphExtents, bool) {
	if ,  := .extentsCache.get();  {
		return , 
	}
	,  := .glyphExtentsRaw()
	if  {
		.extentsCache.set(, )
	}
	return , 
}