| [ Return to Bugs & Features | SVN ⇄ GIT ]
STR #2761
Application: | FLTK Library |
Status: | 2 - Closed w/o Resolution |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | Force break when wrapping long words |
Version: | 1.4-feature |
Created By: | dfatfl |
Assigned To: | AlbrechtS |
Fix Version: | Will Not Fix |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | dfatfl 22:09 Nov 03, 2011 |
| This adds an option to force long words to break if they don't fit the width in fl_expand_text (which is used by the various fl_draw and fl_measure functions). This is especially helpful in things like fl_choice or other situations where all data must show. The option is enabled by setting fl_force_wrap_breaks=1. This was lightly tested against some strings that were causing fl_choice to cut off text. Full test probably needed, especially against non-printable data (< ' ' or 127) that is converted to ^X format. | |
|
#2 | matt 13:57 Dec 10, 2011 |
| Could you please add a short self-contained test program? Just to verify that I correctly understand the issue, and so that I can test UTF8. | |
|
#3 | dfatfl 23:24 Dec 10, 2011 |
| Just use fl_choice with a long string with no white space.
"The path is: How/about/a/long/path/that/has/no/spaces/in/it/but/you/want/to/ensure/the/full/p ath/shows/when/it/is/displayed/on/the/message." | |
|
#4 | greg.ercolano 10:12 Dec 11, 2011 |
| Can't replicate with OP's text; try test.cxx attached. | |
|
#5 | dfatfl 14:05 Dec 12, 2011 |
| I thought fl_choice had the problem too, I could have sworn it cut it off. I think I know why, the string had an @ in it and it was cutoff because of that, when I applied one of the @ fixes, it must have still been limiting width to the @ sign then not wrapping the rest. Anyway, you can cause the problem with the code being attached. Uncomment the line after applying the patch to see the fix work. | |
|
#6 | greg.ercolano 14:45 Dec 12, 2011 |
| Sounds like maybe we need an FL_ALIGN_WRAP_HARD to hard break lines. This could then be backwards compatible. | |
|
#7 | dfatfl 16:20 Dec 12, 2011 |
| needs to work any time you want to call on fl_measure ( in addition to fl_draw or fl_expand_text) so would need additional code to handle a new option. The current patch is already backwards compatible in that the app has to set the option on for it to do anything (and doesn't require adding additional parameters). I think of it as more a fix than feature, only making backwards compatible to not break things based off the one that miscalculated wrapping. | |
|
#8 | fabien 18:17 Apr 21, 2012 |
| If possible, that would be great _not_ have a new option for a bug fix. Is there any downside of of fixing that problem in terms of backward compability (i.e. would it break 1.1 source compatibility) without adding a new mode that fiexs it ? | |
|
#9 | AlbrechtS 03:11 Oct 20, 2012 |
| Changed priority to 1: RFE.
This is in fact a request for a new feature, and the proposed change needs to be discussed thoroughly. Adding a global option that changes basic string rendering looks like a big change that shouldn't be done in a normal release. | |
|
#10 | AlbrechtS 02:59 Feb 07, 2019 |
| Note: the patch (force-wrap.patch) is not UTF-8 compatible. Stepping backwards and forwards in strings must be done with UTF-8 compatible functions.
This STR has been superseded by the cumulative patch in STR #3485 which presumably will have the same issue (not checked though).
We *must* also avoid adding new global public variables (like here: fl_force_wrap_breaks) because this is bad (API-wise). We need public methods to set and query global options if at all.
See https://www.fltk.org/str.php?L3485.
Comment: the ideas is not bad but we need a better API.
Please open a new STR (or GitHub issue or PR) if necessary. But before that, please discuss the additional API in fltk.coredev so we can get consensus.
Closed. Will not fix. | |
[ Return to Bugs & Features ]
|
| |