mirror of
https://github.com/godotengine/godot.git
synced 2024-12-21 10:25:24 +08:00
4c3f7d1290
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
|
|
#pragma once
|
|
|
|
#include "Shape.h"
|
|
#include "edge-selectors.h"
|
|
|
|
namespace msdfgen {
|
|
|
|
/// Simply selects the nearest contour.
|
|
template <class EdgeSelector>
|
|
class SimpleContourCombiner {
|
|
|
|
public:
|
|
typedef EdgeSelector EdgeSelectorType;
|
|
typedef typename EdgeSelector::DistanceType DistanceType;
|
|
|
|
explicit SimpleContourCombiner(const Shape &shape);
|
|
void reset(const Point2 &p);
|
|
EdgeSelector & edgeSelector(int i);
|
|
DistanceType distance() const;
|
|
|
|
private:
|
|
EdgeSelector shapeEdgeSelector;
|
|
|
|
};
|
|
|
|
/// Selects the nearest contour that actually forms a border between filled and unfilled area.
|
|
template <class EdgeSelector>
|
|
class OverlappingContourCombiner {
|
|
|
|
public:
|
|
typedef EdgeSelector EdgeSelectorType;
|
|
typedef typename EdgeSelector::DistanceType DistanceType;
|
|
|
|
explicit OverlappingContourCombiner(const Shape &shape);
|
|
void reset(const Point2 &p);
|
|
EdgeSelector & edgeSelector(int i);
|
|
DistanceType distance() const;
|
|
|
|
private:
|
|
Point2 p;
|
|
std::vector<int> windings;
|
|
std::vector<EdgeSelector> edgeSelectors;
|
|
|
|
};
|
|
|
|
}
|