<commit_before>#pragma once

#include "labels/label.h"

#include <glm/glm.hpp>
#include <limits>

namespace Tangram {

class TextLabels;
class TextStyle;

struct GlyphQuad {
    size_t atlas;
    struct {
        glm::i16vec2 pos;
        glm::u16vec2 uv;
    } quad[4];
};

struct TextRange {
    TextLabelProperty::Align align;
    Range range;
};

struct TextVertex {
    glm::i16vec2 pos;
    glm::u16vec2 uv;
    struct State {
        uint32_t color;
        uint32_t stroke;
        uint16_t alpha;
        uint16_t scale;
    } state;

    const static float position_scale;
    const static float alpha_scale;
};

class TextLabel : public Label {

public:

    struct FontVertexAttributes {
        uint32_t fill;
        uint32_t stroke;
        uint8_t fontScale;
    };

    TextLabel(Label::Transform _transform, Type _type, Label::Options _options,
              LabelProperty::Anchor _anchor, TextLabel::FontVertexAttributes _attrib,
              glm::vec2 _dim, TextLabels& _labels, std::vector<TextRange> _textRanges);

    void updateBBoxes(float _zoomFract) override;

    size_t allQuadRange() const;

    std::vector<TextRange>& textRanges() {
        return m_textRanges;
    }

protected:

    void pushTransform() override;

private:
    void applyAnchor(const glm::vec2& _dimension, const glm::vec2& _origin,
                     LabelProperty::Anchor _anchor) override;

    // Back-pointer to owning container
    const TextLabels& m_textLabels;

    // first vertex and count in m_textLabels quads
    std::vector<TextRange> m_textRanges;

    FontVertexAttributes m_fontAttrib;

    // TODO: remove me
    int rangeindex = 0;
};

}<commit_msg>squash: Remove unused<commit_after>#pragma once

#include "labels/label.h"

#include <glm/glm.hpp>

namespace Tangram {

class TextLabels;
class TextStyle;

struct GlyphQuad {
    size_t atlas;
    struct {
        glm::i16vec2 pos;
        glm::u16vec2 uv;
    } quad[4];
};

struct TextRange {
    TextLabelProperty::Align align;
    Range range;
};

struct TextVertex {
    glm::i16vec2 pos;
    glm::u16vec2 uv;
    struct State {
        uint32_t color;
        uint32_t stroke;
        uint16_t alpha;
        uint16_t scale;
    } state;

    const static float position_scale;
    const static float alpha_scale;
};

class TextLabel : public Label {

public:

    struct FontVertexAttributes {
        uint32_t fill;
        uint32_t stroke;
        uint8_t fontScale;
    };

    TextLabel(Label::Transform _transform, Type _type, Label::Options _options,
              LabelProperty::Anchor _anchor, TextLabel::FontVertexAttributes _attrib,
              glm::vec2 _dim, TextLabels& _labels, std::vector<TextRange> _textRanges);

    void updateBBoxes(float _zoomFract) override;

    std::vector<TextRange>& textRanges() {
        return m_textRanges;
    }

protected:

    void pushTransform() override;

private:
    void applyAnchor(const glm::vec2& _dimension, const glm::vec2& _origin,
                     LabelProperty::Anchor _anchor) override;

    // Back-pointer to owning container
    const TextLabels& m_textLabels;

    // first vertex and count in m_textLabels quads
    std::vector<TextRange> m_textRanges;

    FontVertexAttributes m_fontAttrib;

    // TODO: remove me
    int rangeindex = 0;
};

}
{'fraction_non_alphanumeric': 0.08873410054512416, 'fraction_numerical': 0.018170805572380374, 'mean_word_length': 2.8996458087367176, 'pattern_counts': {'":': 0, '<': 12, '<?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': '5688896', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1033, 'n_words': 265}