Author: matt
Date: 2011-10-01 08:43:32 -0700 (Sat, 01 Oct 2011)
New Revision: 9109
Log:
STR 2701: more tolerant Xft Font Attribute interpretation. Also added a waring
to STR 2704 about using buffer modification callbacks in TextDisplay.
Modified:
branches/branch-3.0/src/fltk3/TextDisplay.cxx
branches/branch-3.0/src/fltk3/xft_set_fonts.cxx
Modified: branches/branch-3.0/src/fltk3/TextDisplay.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/TextDisplay.cxx 2011-10-01 15:42:39 UTC
(rev 9108)
+++ branches/branch-3.0/src/fltk3/TextDisplay.cxx 2011-10-01 15:43:32 UTC
(rev 9109)
@@ -1381,6 +1381,10 @@
Callback attached to the text buffer to receive delete information before
the modifications are actually made.
+
+ This callback can be used to adjust
+ the display or update other setting. It is not advisable to change any
+ buffers or text in this callback, or line counting may get out of sync.
\param pos starting index of deletion
\param nDeleted number of bytes we will delete (must be UTF-8 aligned!)
@@ -1411,6 +1415,10 @@
Callback attached to the text buffer to receive modification information
+ This callback can be used to adjust
+ the display or update other setting. It is not advisable to change any
+ buffers or text in this callback, or line counting may get out of sync.
+
\param pos starting index of modification
\param nInserted number of bytes we inserted (must be UTF-8 aligned!)
\param nDeleted number of bytes deleted (must be UTF-8 aligned!)
Modified: branches/branch-3.0/src/fltk3/xft_set_fonts.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/xft_set_fonts.cxx 2011-10-01 15:42:39 UTC
(rev 9108)
+++ branches/branch-3.0/src/fltk3/xft_set_fonts.cxx 2011-10-01 15:43:32 UTC
(rev 9109)
@@ -131,7 +131,7 @@
while ((style) && (style < last))
{
int type;
- while ((*style == '=') || (*style == ' ') || (*style == '\t'))
+ while ((*style == '=') || (*style == ' ') || (*style == '\t') || (*style
== ','))
{
style++; // Start of Style string
if ((style >= last) || (*style == 0)) continue;
@@ -174,7 +174,7 @@
goto NEXT_STYLE;
} // switch end
NEXT_STYLE:
- while ((*style != ' ') && (*style != '\t'))
+ while ((*style != ' ') && (*style != '\t') && (*style != ','))
{
style++;
if ((style >= last) || (*style == 0)) goto STYLE_DONE;
@@ -285,10 +285,12 @@
first = (char *)font; // name is just what was returned
}
// Truncate the name after the (english) modifiers description
- if (stop)
- {
- *stop = 0; // Terminate the string at the first comma, if there is one
- }
+ // Matt: Actually, there is no guarantee that the *first* description is
the English one.
+ // Matt: So we keep the entire description, just in case.
+ //if (stop)
+ //{
+ // *stop = 0; // Terminate the string at the first comma, if there is
one
+ //}
// Copy the font description into our list
if (first == (char *)font)
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit