mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Move font API to GpCommon
This commit is contained in:
12
GpCommon/GpFontHandler.h
Normal file
12
GpCommon/GpFontHandler.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
class GpIOStream;
|
||||
struct IGpFont;
|
||||
|
||||
struct IGpFontHandler
|
||||
{
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual IGpFont *LoadFont(GpIOStream *stream) = 0;
|
||||
virtual bool KeepStreamOpen() const = 0;
|
||||
};
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
struct GpFontHandlerProperties
|
||||
{
|
||||
EGpFontHandlerType m_type;
|
||||
EGpFontHandlerType m_type;
|
||||
};
|
||||
|
||||
10
GpCommon/GpRenderedFontMetrics.h
Normal file
10
GpCommon/GpRenderedFontMetrics.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct GpRenderedFontMetrics
|
||||
{
|
||||
int32_t m_ascent;
|
||||
int32_t m_descent;
|
||||
int32_t m_linegap;
|
||||
};
|
||||
15
GpCommon/GpRenderedGlyphMetrics.h
Normal file
15
GpCommon/GpRenderedGlyphMetrics.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct GpRenderedGlyphMetrics
|
||||
{
|
||||
size_t m_glyphDataPitch;
|
||||
|
||||
uint32_t m_glyphWidth;
|
||||
uint32_t m_glyphHeight;
|
||||
|
||||
int16_t m_bearingX;
|
||||
int16_t m_bearingY;
|
||||
int16_t m_advanceX;
|
||||
};
|
||||
13
GpCommon/IGpFont.h
Normal file
13
GpCommon/IGpFont.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct IGpFontRenderedGlyph;
|
||||
struct GpRenderedFontMetrics;
|
||||
|
||||
struct IGpFont
|
||||
{
|
||||
virtual void Destroy() = 0;
|
||||
virtual IGpFontRenderedGlyph *Render(uint32_t unicodeCodePoint, unsigned int size, bool aa) = 0;
|
||||
virtual bool GetLineSpacing(unsigned int size, int32_t &outSpacing) = 0;
|
||||
};
|
||||
12
GpCommon/IGpFontHandler.h
Normal file
12
GpCommon/IGpFontHandler.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
class GpIOStream;
|
||||
struct IGpFont;
|
||||
|
||||
struct IGpFontHandler
|
||||
{
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual IGpFont *LoadFont(GpIOStream *stream) = 0;
|
||||
virtual bool KeepStreamOpen() const = 0;
|
||||
};
|
||||
10
GpCommon/IGpFontRenderedGlyph.h
Normal file
10
GpCommon/IGpFontRenderedGlyph.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
struct GpRenderedGlyphMetrics;
|
||||
|
||||
struct IGpFontRenderedGlyph
|
||||
{
|
||||
virtual const GpRenderedGlyphMetrics &GetMetrics() const = 0;
|
||||
virtual const void *GetData() const = 0;
|
||||
virtual void Destroy() = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user