<commit_before>/*
 * THE NEW CHRONOTEXT TOOLKIT: https://github.com/arielm/new-chronotext-toolkit
 * COPYRIGHT (C) 2012, <NAME> ALL RIGHTS RESERVED.
 *
 * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE MODIFIED BSD LICENSE:
 * https://github.com/arielm/new-chronotext-toolkit/blob/master/LICENSE.md
 */

#include "chronotext/font/xf/Font.h"
#include "chronotext/font/xf/FontManager.h"

using namespace ci;
using namespace std;

namespace chronotext
{
    namespace xf
    {
        Font::Font(FontManager &fontManager, FontData *data, FontTexture *texture, const Properties &properties)
        :
        texture(texture),
        properties(properties),
        indices(fontManager.getIndices(properties.slotCapacity)),
        began(0),
        hasClip(false),
        sequence(nullptr)
        {
            assert(properties.slotCapacity > 0);
            assert(properties.slotCapacity <= 8192);

            // ---
            
            glyphCount = data->glyphCount;
            glyphs = data->glyphs;
            
            baseSize = data->baseSize;
            height = data->height;
            ascent = data->ascent;
            descent = data->descent;
            spaceAdvance = data->spaceAdvance;
            strikethroughFactor = data->strikethroughFactor;
            underlineOffset = data->underlineOffset;
            lineThickness = data->lineThickness;
            
            w = data->w;
            h = data->h;
            le = data->le;
            te = data->te;
            advance = data->advance;
            
            u1 = data->u1;
            v1 = data->v1;
            u2 = data->u2;
            v2 = data->v2;
            
            // ---
            
            if (gl::isExtensionAvailable("GL_EXT_texture_filter_anisotropic"))
            {
                if (properties.useAnisotropy)
                {
                    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &anisotropy);
                }
                else
                {
                    anisotropy = 1;
                }
            }
            else
            {
                anisotropy = 0;
            }
            
            // ---
            
            setSize(baseSize);
            setDirection(+1);
            setAxis(Vec2f(+1, +1));
            setColor(0, 0, 0, 1);
        }
        
        bool Font::isSpace(wchar_t c) const
        {<commit_msg>COSMETICS<commit_after>/*
 * THE NEW CHRONOTEXT TOOLKIT: https://github.com/arielm/new-chronotext-toolkit
 * COPYRIGHT (C) 2012, <NAME> ALL RIGHTS RESERVED.
 *
 * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE MODIFIED BSD LICENSE:
 * https://github.com/arielm/new-chronotext-toolkit/blob/master/LICENSE.md
 */

#include "chronotext/font/xf/Font.h"
#include "chronotext/font/xf/FontManager.h"

using namespace ci;
using namespace std;

namespace chronotext
{
    namespace xf
    {
        Font::Font(FontManager &fontManager, FontData *data, FontTexture *texture, const Properties &properties)
        :
        texture(texture),
        properties(properties),
        indices(fontManager.getIndices(properties.slotCapacity)),
        began(0),
        hasClip(false),
        sequence(nullptr)
        {
            assert(properties.slotCapacity > 0);
            assert(properties.slotCapacity <= 8192);

            // ---
            
            glyphCount = data->glyphCount;
            glyphs = data->glyphs;
            
            baseSize = data->baseSize;
            height = data->height;
            ascent = data->ascent;
            descent = data->descent;
            spaceAdvance = data->spaceAdvance;
            strikethroughFactor = data->strikethroughFactor;
            underlineOffset = data->underlineOffset;
            lineThickness = data->lineThickness;
            
            w = data->w;
            h = data->h;
            le = data->le;
            te = data->te;
            advance = data->advance;
            
            u1 = data->u1;
            v1 = data->v1;
            u2 = data->u2;
            v2 = data->v2;
            
            // ---
            
            if (gl::isExtensionAvailable("GL_EXT_texture_filter_anisotropic"))
            {
                if (properties.useAnisotropy)
                {
                    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &anisotropy);
                }
                else
                {
                    anisotropy = 1;
                }
            }
            else
            {
                anisotropy = 0;
            }
            
            // ---
            
            setSize(baseSize);
            setDirection(+1);
            setAxis(+1, +1);
            setColor(0, 0, 0, 1);
        }
        
        bool Font::isSpace(wchar_t c) const
        {
{'fraction_non_alphanumeric': 0.10377161908730985, 'fraction_numerical': 0.011460720983538238, 'mean_word_length': 1.344894968246214, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 45, 'https://': 4, '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': '2340120', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1341, 'n_words': 238}