Search found 25 matches

by qwdqwqwffqw
Tue Jun 04, 2024 8:42 am
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Re: Why fonts look different on LOVE than on web browser?

I finally solved this issue. You are right. TextBatch should be better choice. Also I did some tests after you mentioned GlyphData, and I found out advance of single glyph(GlyphData:getAdvance()) isn't always same as width of single glyph(font:getWidth("X")); sometimes they are same but so...
by qwdqwqwffqw
Wed May 29, 2024 11:25 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Re: Why fonts look different on LOVE than on web browser?

By the way, the code is : -- big = big font size -- small = small(main) font size function alt_print(s, x, y) love.graphics.setFont(font) for i=1, #s do -- Ascii only example(1glyph=1byte) x = math.round(x) love.graphics.print(s:sub(i, i), x, y) if i < #s then x = x + bigFont:getWidth(s(i))*small/bi...
by qwdqwqwffqw
Wed May 29, 2024 10:31 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Re: Why fonts look different on LOVE than on web browser?

Why not use a bitmap font? Thanks for the advice, but I'm afraid it wouldn't be better approach for the purpose. To get texts rendered in LOVE similar to those of other universal programs (for readability and aesthetic), the requirements would be : [1] Each glyph should be rendered precisely, which...
by qwdqwqwffqw
Wed May 29, 2024 7:46 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Re: Why fonts look different on LOVE than on web browser?

I tried out many things to fix this problem for some time. So I am sharing what I've found out so far. In LOVE, its determining X-coordinate for each next character seems not precise(it tends to be biased toward lefter position than it should). So, just adjusting kerning is not enough(and is not as ...
by qwdqwqwffqw
Wed Mar 20, 2024 2:02 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Re: Why fonts look different on LOVE than on web browser?

Oh, sorry for not providing any examples & code. Here is an example with Segoe UI TTF file(system font. file could be found in C:\Windows\Fonts), but similar difference could be found in other font files including OTF ones. 1. A paragraph from love2d github page(I added "/" for better ...
by qwdqwqwffqw
Wed Mar 13, 2024 12:05 am
Forum: Support and Development
Topic: [SOLVED] Question about Tilemap
Replies: 3
Views: 2040

Re: Question about Tilemap

I think error is because of using "=" instead of "==", in "if tile = 11 then"?
by qwdqwqwffqw
Tue Mar 12, 2024 11:37 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 12
Views: 5199

Why fonts look different on LOVE than on web browser?

It's nothing really problematic, but I've been wondering why same font(+ same size & same text) looks different on Love, than on web browser, pdf viewer, etc. The text rendered in love seems to have same heights but narrower width. After several testing, I noticed it's not only letter spacing &a...
by qwdqwqwffqw
Wed May 31, 2023 2:10 pm
Forum: Support and Development
Topic: Font kerning not working (and mouse cursor control)
Replies: 4
Views: 1582

Re: Font kerning not working (and mouse cursor control)

love 12 has much better glyph/text positioning in love.graphics.print and friends than previous versions for a lot of fonts, since it uses Harfbuzz for text shaping. But that new text shaping doesn't really match with the concept of computing glyphs independently and adding together offsets and ker...
by qwdqwqwffqw
Fri May 26, 2023 10:21 pm
Forum: Support and Development
Topic: Font kerning not working (and mouse cursor control)
Replies: 4
Views: 1582

Re: Font kerning not working (and mouse cursor control)

After still getting same result(kerning=0) with your suggested font file, I found out that it only happens in 12.0 version(in-development version). And yes, it works well in 11.4 released version.
Binary search would be definitely better option. Thanks for the help!
by qwdqwqwffqw
Fri May 26, 2023 9:55 am
Forum: Support and Development
Topic: Font kerning not working (and mouse cursor control)
Replies: 4
Views: 1582

Font kerning not working (and mouse cursor control)

Hi. I'm trying to make editable text box in LOVE. In order to place cursor and select texts with mouse, calculating which character x position of mouse cursor lays on is necessary. However, font:getKerning() function doesn't seem to be working. It always returns zero, even when font:getWidth() of tw...