<commit_before>// Copyright (C) 2012-2014 by krepa098. All rights reserved.
// Use of this source code is governed by a zlib-style
// license that can be found in the license.txt file.

package gosfml2

// #include <SFML/Graphics/Text.h>
// #include <SFML/Graphics/RenderWindow.h>
// #include <SFML/Graphics/RenderTexture.h>
// #include <stdlib.h>
import "C"

import (
	"runtime"
	"unsafe"
)

/////////////////////////////////////
///		CONSTS
/////////////////////////////////////

const (
	TextRegular    = C.sfTextRegular    ///< Regular characters, no style
	TextBold       = C.sfTextBold       ///< Characters are bold
	TextItalic     = C.sfTextItalic     ///< Characters are in italic
	TextUnderlined = C.sfTextUnderlined ///< Characters are underlined
)

type TextStyle uint32

/////////////////////////////////////
///		STRUCTS
/////////////////////////////////////

type Text struct {
	cptr *C.sfFont
	font *Font
}

/////////////////////////////////////
///		FUNCS
/////////////////////////////////////

// Create a new text with a given font (can be nil).
func NewText(font *Font) (*Text, error) {
	if cptr := C.sfText_create(); cptr != nil {
		text := &Text{cptr: cptr}
		runtime.SetFinalizer(text, (*Text).destroy)<commit_msg>Text.cptr sfFont -> sfText<commit_after>// Copyright (C) 2012-2014 by krepa098. All rights reserved.
// Use of this source code is governed by a zlib-style
// license that can be found in the license.txt file.

package gosfml2

// #include <SFML/Graphics/Text.h>
// #include <SFML/Graphics/RenderWindow.h>
// #include <SFML/Graphics/RenderTexture.h>
// #include <stdlib.h>
import "C"

import (
	"runtime"
	"unsafe"
)

/////////////////////////////////////
///		CONSTS
/////////////////////////////////////

const (
	TextRegular    = C.sfTextRegular    ///< Regular characters, no style
	TextBold       = C.sfTextBold       ///< Characters are bold
	TextItalic     = C.sfTextItalic     ///< Characters are in italic
	TextUnderlined = C.sfTextUnderlined ///< Characters are underlined
)

type TextStyle uint32

/////////////////////////////////////
///		STRUCTS
/////////////////////////////////////

type Text struct {
	cptr *C.sfText
	font *Font
}

/////////////////////////////////////
///		FUNCS
/////////////////////////////////////

// Create a new text with a given font (can be nil).
func NewText(font *Font) (*Text, error) {
	if cptr := C.sfText_create(); cptr != nil {
		text := &Text{cptr: cptr}
		runtime.SetFinalizer(text, (*Text).destroy)
{'fraction_non_alphanumeric': 0.2858866103739445, 'fraction_numerical': 0.011258544431041415, 'mean_word_length': 1.602510460251046, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 12, 'https://': 0, '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': '1472422', 'n_tokens_mistral': 771, 'n_tokens_neox': 735, 'n_words': 211}