Skip to content

Commit

Permalink
GTK: make OSD scalable (#769)
Browse files Browse the repository at this point in the history
* gtk: make OSD scalable

* Scale save slot indicator (oops), make text outlines look smoother, use
larger font when not scaling

* Save and load HUD layout, prefer raster font on low resolution, select
vector font size close to raster one, make OSDCLASS::scale floating point

* Build fix

* Add reset HUD layout action, only require fontconfig if libagg is found.

* Try another font in case we could not locate monospace

* Detect screen bytes per pixel instead of hardcoding it, define
AGG2D_USE_VECTORFONTS if fontconfig is found.

* Different pixel formats are handled by different draw target
implementations
  • Loading branch information
thesourcehim committed Feb 14, 2024
1 parent 6508c2b commit 45738be
Show file tree
Hide file tree
Showing 10 changed files with 470 additions and 121 deletions.
15 changes: 13 additions & 2 deletions desmume/src/frontend/modules/osd/agg/agg2d.inl
Expand Up @@ -1370,6 +1370,17 @@ AGG2D_TEMPLATE void TAGG2D::text(double x, double y, const wchar_t* str, unsigne
}

}

AGG2D_TEMPLATE double TAGG2D::textWidth(const char* str)
{
return textWidth(str, (unsigned int)strlen(str));
}

AGG2D_TEMPLATE void TAGG2D::text(double x, double y, const char* str, bool roundOff, double dx, double dy)
{
text(x, y, str, (unsigned int)strlen(str), roundOff, dx, dy);
}

#endif

//------------------------------------------------------------------------
Expand Down Expand Up @@ -1945,11 +1956,11 @@ AGG2D_TEMPLATE void TAGG2D::render(FontRasterizer& ras, FontScanline& sl)
{
if(m_blendMode == BlendAlpha)
{
Agg2DRenderer::render(*this, m_renBase, m_renSolid, ras, sl);
Agg2DRenderer<PixFormatSet, PixFormatSet>::render(*this, m_renBase, m_renSolid, ras, sl);
}
else
{
Agg2DRenderer::render(*this, m_renBaseComp, m_renSolidComp, ras, sl);
Agg2DRenderer<PixFormatSet, PixFormatSet>::render(*this, m_renBaseComp, m_renSolidComp, ras, sl);
}
}

Expand Down

0 comments on commit 45738be

Please sign in to comment.