1. Anders Ruud
  2. love
  3. Issues

Issues

Issue #1269 closed

Font clipping on right border

Varun Gandhi
created an issue

Love version 0.10.2 (Super Toast)

Issue: Drawing text objects via draw leads to clipping sometimes, especially from the right side and for characters which have curves on the right side.

Minimal example:

function love.load()
    font = love.graphics.newFont("UbuntuMono-R.ttf", 120)
    text = love.graphics.newText(font, "BDOPQS")
end
function
    love.graphics.draw(text, 200, 200)
end

Ubuntu Mono

clipping.png

Inconsolata

clipping2.png

Fonts used: Ubuntu Mono Regular, Inconsolata

Comments (10)

  1. Alex Szpakowski

    I don't have the clipping issues on macOS - what OS are you using? If Linux, what version of FreeType do you have installed? Maybe there's a rasterization bug in one of their versions.

  2. Raidho

    I believe that's related to bitmap font rendering issue, same exact sympthoms. Which then leads me to believe it's LÖVE's internal issue, not any of its libraries.

    More specifically I believe that's a combination of specific quad glyph placement and lack of 1px padding on glyph quads which you'd normally use for all 2d sprites.

  3. Raidho

    Alex Szpakowski No I cannot but I can confirm that under manipulation right-hand side is clipped far more prominently than other sides. This "natural" shortcoming may be excarebrated by driver-related quirks so that the glyphs clip even under normal circumstances.

    I haven't looked into the source code but I believe it's a case of off-by-one error, and lack of padding error which you've already resolved.

  4. Varun Gandhi reporter

    Hmm, this is strange. I'm unable to reproduce the issue right now -- the severity of clipping is very less, similar to what Raidho is talking about -- with either Freetype 2.5.5 or 2.7.1 installed. Does Love use the system's Freetype installation at all? I suppose you could close the issue ...

  5. Alex Szpakowski

    LÖVE provides its own FreeType on Windows, macOS, and iOS. I'm not sure what Android does. On Linux it generally uses whatever's installed globally on the system I believe.

  6. Log in to comment