mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 12:09:36 +00:00
Menu work, move VOS queue interface
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "HostFontHandler.h"
|
||||
#include "HostFontRenderedGlyph.h"
|
||||
#include "MacRoman.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "RenderedFont.h"
|
||||
#include "RenderedGlyphMetrics.h"
|
||||
|
||||
@@ -19,6 +20,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
public:
|
||||
bool GetGlyph(unsigned int character, const RenderedGlyphMetrics **outMetricsPtr, const void **outData) const override;
|
||||
size_t MeasureString(const uint8_t *chars, size_t len) const override;
|
||||
|
||||
void Destroy() override;
|
||||
|
||||
@@ -59,6 +61,19 @@ namespace PortabilityLayer
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t RenderedFontImpl::MeasureString(const uint8_t *chars, size_t len) const
|
||||
{
|
||||
size_t measure = 0;
|
||||
|
||||
for (size_t i = 0; i < len; i++)
|
||||
{
|
||||
const RenderedGlyphMetrics &metrics = m_metrics[chars[i]];
|
||||
measure += metrics.m_advanceX;
|
||||
}
|
||||
|
||||
return measure;
|
||||
}
|
||||
|
||||
void RenderedFontImpl::Destroy()
|
||||
{
|
||||
this->~RenderedFontImpl();
|
||||
|
||||
Reference in New Issue
Block a user