<commit_before>// Copyright 2015, <NAME> <<EMAIL>>
// See the LICENSE file for more details.

package fizzle

/*
Based primarily on gltext found at https://github.com/go-gl/gltext
But also based on examples from the freetype-go project:
  code.google.com/p/freetype-go/freetype

This implementation differs in the way the images are rendered and then
copied into an OpenGL texture. In addition to that, this module can
create a renderable 'string' node which is a bunch of polygons with uv's
mapped to the appropriate glyphs.
*/

import (
	ft "code.google.com/p/freetype-go/freetype"
	"errors"
	"fmt"
	gl "github.com/go-gl/gl/v3.3-core/gl"
	"image"
	"image/draw"
	"io/ioutil"
	"os"
)

// runeData stores information pulled from the freetype parsing of glyphs.
type runeData struct {
	imgX, imgY                    int // offset into the image texture for the top left position of rune
	advanceWidth, leftSideBearing int // HMetric data from glyph
	advanceHeight, topSideBearing int // VMetric data from glyph
	uvMinX, uvMinY                float32
	uvMaxX, uvMaxY                float32
}

// GLFont contains data regarding a font and the texture that was created
// with the specified set of glyphs. It can then be used to create
// renderable string objects.
type GLFont struct {
	Texture     uint32
	TextureSize int<commit_msg>updated reference of freetype-go to my fork.<commit_after>// Copyright 2015, <NAME> <<EMAIL>>
// See the LICENSE file for more details.

package fizzle

/*
Based primarily on gltext found at https://github.com/go-gl/gltext
But also based on examples from the freetype-go project:
  code.google.com/p/freetype-go/freetype

This implementation differs in the way the images are rendered and then
copied into an OpenGL texture. In addition to that, this module can
create a renderable 'string' node which is a bunch of polygons with uv's
mapped to the appropriate glyphs.
*/

import (
	"errors"
	"fmt"
	"image"
	"image/draw"
	"io/ioutil"
	"os"

	gl "github.com/go-gl/gl/v3.3-core/gl"
	ft "github.com/tbogdala/freetype-go/freetype"
)

// runeData stores information pulled from the freetype parsing of glyphs.
type runeData struct {
	imgX, imgY                    int // offset into the image texture for the top left position of rune
	advanceWidth, leftSideBearing int // HMetric data from glyph
	advanceHeight, topSideBearing int // VMetric data from glyph
	uvMinX, uvMinY                float32
	uvMaxX, uvMaxY                float32
}

// GLFont contains data regarding a font and the texture that was created
// with the specified set of glyphs. It can then be used to create
// renderable string objects.
type GLFont struct {
	Texture     uint32
	TextureSize int
{'fraction_non_alphanumeric': 0.0738678544914625, 'fraction_numerical': 0.008908685968819599, 'mean_word_length': 3.257503949447077, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2569168', 'n_tokens_mistral': 869, 'n_tokens_neox': 822, 'n_words': 339}