Possible bug or oversight.

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
JD_Mortal
Regular
Posts: 37
Joined: Mon Jul 21, 2014 3:01 am

Possible bug or oversight.

#1 Post by JD_Mortal » Mon Jul 21, 2014 7:14 am

The "bug": Text does not conform to the say_window, when the contents are more than three lines, while justified.

This is noticed with this code:

Code: Select all

style say_window:
    yminimum 0
    xmargin 10
    bottom_margin 15
    xpadding 10
    ypadding 5

style say_dialogue:
    first_indent 54
    rest_indent 0
    justify True
    
style say_thought:
    first_indent 54
    rest_indent 0
    justify True

label start:
    "NOTICE:" "Do not forget to disable DEVELOPER MODE, before release. This is a justification
               test for everything to see if it works for stretching the words to the screen."
    "This runs out of the box. Summer is almost near. The days have grown longer and the
     heatwaves have already begun. Air-conditioners can be heard humming away, in the silent night air."
    "" "This is a trick to look like a thought, but it is just an invisible name. This rolls off the edge too.
        You can not remember the last time you were allowed to do anything \"FUN\", in this town.
        Everyone except you, will be doing something fun this summer, you are sure."
    return
Not sure why, but the window size is getting lengthened on those. (Expanding, not obeying size constraints?)
Screen_width - padding(r/l) - margin(r/l) != window width

Also does this without justify, and with indent...

It is not taking the indent into consideration, as part of the "width" of the text-line. When justified, all text is matched to the text-line-width plus the indent-width. That seems to be where the extra "space" is forcing the text-box to expand.

The wrap-around is also leaving more space than needed, on left justify. Eg, The word "feet" at the end of one line is pushed to the next line, though there was enough room to fit the word "feet" + 1 more letter. This implies that the word-width is not being calculated correctly, or is off by 1. (Might be one of those things in code that starts counting at 0 or 1, and you are using 1 or 0 for the formula that breaks the text-lines?)

In any event, the formula is not taking all constraints into account, when it formulates the line-breaks. (Screen-width - margins - paddings) and (indents), which are not being counted as part of the text-width. (Not sure why NBSP isn't used. The other "space" in ASCII is a Non-breaking-line-space, treated as a letter, part of a word.)

Justify also seems to have padding on the right-side. The text is being justified, but left-aligned, justified into a smaller area than the width, when padding and margins are removed. Thus, not filling the whole width, and not "aligning justified text center". (equal space left and right) say_vbox is smaller than the say_window.

Post Reply

Who is online

Users browsing this forum: No registered users