mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
39 lines
975 B
C++
39 lines
975 B
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
class PLPasStr;
|
|
|
|
namespace PortabilityLayer
|
|
{
|
|
struct RenderedFontMetrics;
|
|
|
|
struct RenderedGlyphMetrics;
|
|
|
|
class RenderedFont
|
|
{
|
|
public:
|
|
virtual bool GetGlyph(unsigned int character, const RenderedGlyphMetrics *&outMetricsPtr, const void *&outData) const = 0;
|
|
virtual const RenderedFontMetrics &GetMetrics() const = 0;
|
|
virtual size_t MeasureString(const uint8_t *chars, size_t len) const = 0;
|
|
virtual bool IsAntiAliased() const = 0;
|
|
|
|
virtual void Destroy() = 0;
|
|
|
|
size_t MeasureCharStr(const char *str, size_t len) const;
|
|
size_t MeasurePStr(const PLPasStr &pstr) const;
|
|
};
|
|
}
|
|
|
|
#include "PLPasStr.h"
|
|
|
|
inline size_t PortabilityLayer::RenderedFont::MeasurePStr(const PLPasStr &pstr) const
|
|
{
|
|
return this->MeasureString(pstr.UChars(), pstr.Length());
|
|
}
|
|
|
|
inline size_t PortabilityLayer::RenderedFont::MeasureCharStr(const char *str, size_t len) const
|
|
{
|
|
return this->MeasureString(reinterpret_cast<const uint8_t*>(str), len);
|
|
}
|