# OpenGL Font issue

**URL:** <https://forum.juce.com/t/opengl-font-issue/67313>\
**Category:** MacOSX and iOS\
**Created:** [October 7, 2025, 8:28am UTC](https://forum.juce.com/t/opengl-font-issue/67313 "2025-10-07T08:28:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 7, 2025, 8:28am UTC](https://forum.juce.com/t/opengl-font-issue/67313/1 "2025-10-07T08:28:18Z")

</div>

Hi Juce Team !

After switching to Juce8, I have a very different font rendering between OpenGL and regular renderer for some custom font.

Using Juce latest develop.

JUCE\_DISABLE\_COREGRAPHICS\_FONT\_SMOOTHING=1

Please note that for those font I use the new setAscentOverride and setDescentOverride and it do not seems to be taken into account by the openGL renderer

Thanks !

 ![ClassicRenderer](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/0/9/0970b37f5b9c405bcabb38d69ac24eb1ca90b66d.jpeg)

 ![OpenGLRenderer](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/b/3/b32e94b81700f24b0656d83918c6f4830b8fcf96.jpeg)

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 8, 2025, 8:10am UTC](https://forum.juce.com/t/opengl-font-issue/67313/2 "2025-10-08T08:10:26Z")

</div>

Here is a simple IA generated test to reproduce the issue

[Main.cpp](https://forum.juce.com/uploads/short-url/oITUezRysTuWvpYtiGuW9vdllAq.cpp) (1.7 KB)

[MainComponent.h](https://forum.juce.com/uploads/short-url/bm6MmcvD1S7UvYfteTqs4uvju3k.h) (837 Bytes)

[MainComponent.cpp](https://forum.juce.com/uploads/short-url/wywj8hfDkLupiGiUZHyYmGDz15l.cpp) (3.0 KB)

[CMakeLists.txt](https://forum.juce.com/uploads/short-url/snDz4QWLdOpWfKBWLWmSrizLnRa.txt) (799 Bytes)

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 8, 2025, 9:04am UTC](https://forum.juce.com/t/opengl-font-issue/67313/3 "2025-10-08T09:04:55Z")

</div>

![Classic](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/4/3/43f18808e080653bdb888c66c383486dedae1a6e.jpeg)

 ![OpenGL](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/5/7/5773401bff7e787a5c3d29a24f72610b1d861db3.jpeg)

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 9, 2025, 7:04am UTC](https://forum.juce.com/t/opengl-font-issue/67313/4 "2025-10-09T07:04:48Z")

</div>

Claude found the issue !

Summary

The Bug: When using Font::setAscentOverride(), the OpenGL and software renderers were ignoring the override values when rendering glyphs. This caused  
text to be positioned incorrectly.

Root Cause: The Typeface::getLayersForGlyph() function was using native font metrics directly without considering the ascent/descent overrides set on  
the Font object.

The Fix: I modified three files:

1. juce\_Typeface.h - Added optional parameters for ascent and descent overrides to getLayersForGlyph()
2. juce\_Typeface.cpp - Updated getLayersForGlyph() implementation to apply the override values before calculating glyph scaling
3. juce\_RenderingHelpers.h - Updated both call sites (glyph cache and drawGlyph) to pass the ascent/descent overrides from the Font object

The fix ensures that both the software renderer and OpenGL renderer now properly respect setAscentOverride() and setDescentOverride() values, making  
text rendering consistent across all rendering backends.

[juce-ascent-override-fix.patch](https://forum.juce.com/uploads/short-url/3dNNjdpJnhYIo45xqO9NU5Ebv0V.patch) (4.2 KB)

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 9, 2025, 2:36pm UTC](https://forum.juce.com/t/opengl-font-issue/67313/5 "2025-10-09T14:36:50Z")

</div>

Thank you for reporting. A fix is on the way.

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 13, 2025, 6:57am UTC](https://forum.juce.com/t/opengl-font-issue/67313/6 "2025-10-13T06:57:34Z")

</div>

git patch on develop

[juce-ascent-override-fix-develop.patch](https://forum.juce.com/uploads/short-url/5wxnzh5gHbNsSg3qp2ONROV5J3a.patch) (4.2 KB)

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [October 24, 2025, 11:25am UTC](https://forum.juce.com/t/opengl-font-issue/67313/7 "2025-10-24T11:25:44Z")

</div>

A fix has been released on `develop`

> <https://github.com/juce-framework/JUCE/commit/b72343cf8c0876330d682e9d34d6a8b0abf9513b>

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [October 24, 2025, 11:34am UTC](https://forum.juce.com/t/opengl-font-issue/67313/8 "2025-10-24T11:34:02Z")

</div>

> [@attila](#):
>
> [https://github.com/juce-framework/JUCE/commit/b72343cf8c0876330d682e9d34d6a8b0abf9513b](https://github.com/juce-framework/JUCE/commit/b72343cf8c0876330d682e9d34d6a8b0abf9513b)

looks good. Thanks !
