You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tooltip.go
    path of file: ./repos/goneovim/editor
    
    the code of the file until where you have to start completion: package editor

import (
	"bytes"

	"github.com/akiyosi/qt/core"
	"github.com/akiyosi/qt/gui"
	"github.com/akiyosi/qt/widgets"
)

type ColorStr struct {
	hl    *Highlight
	str   string
	width float64
}

// Tooltip is the tooltip
type Tooltip struct {
	widgets.QWidget

	s             *Screen
	text          []*ColorStr
	font          *Font
	fallbackfonts []*Font
	widthSlice    
    
func resolveMetricsInFontFallback(font *Font, fallbackfonts []*Font, char string) float64 {
	if len(fallbackfonts) == 0 {
		return font.fontMetrics.HorizontalAdvance(char, -1)
	}

	hasGlyph := font.hasGlyph(char)
	if hasGlyph {
		return font.fontMetrics.HorizontalAdvance(char, -1)
	} else {
		for _, ff := range fallbackfonts {
			hasGlyph = ff.hasGlyph(char)
			if hasGlyph {
				return ff.fontMetrics.HorizontalAdvance(char, -1)
			}
		}
	}

	return font.fontMetrics.HorizontalAdvance(char, -1)
}