[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp |
Date: |
Tue, 03 Apr 2007 17:21:39 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/04/03 17:21:39
Modified files:
. : ChangeLog
server : edit_text_character.cpp
Log message:
* server/edit_text_character.cpp (format_text): handle
TAB characters.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2768&r2=1.2769
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.50&r2=1.51
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2768
retrieving revision 1.2769
diff -u -b -r1.2768 -r1.2769
--- ChangeLog 3 Apr 2007 17:00:59 -0000 1.2768
+++ ChangeLog 3 Apr 2007 17:21:38 -0000 1.2769
@@ -1,5 +1,7 @@
2007-04-03 Sandro Santilli <address@hidden>
+ * server/edit_text_character.cpp (format_text): handle
+ TAB characters.
* testsuite/misc-ming.all/ming_utils.c: embed a glyph for
the TAB character in our font.
* server/vm/ASHandlers.cpp: extend tag is not in testing
Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- server/edit_text_character.cpp 3 Apr 2007 16:13:07 -0000 1.50
+++ server/edit_text_character.cpp 3 Apr 2007 17:21:38 -0000 1.51
@@ -15,7 +15,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: edit_text_character.cpp,v 1.50 2007/04/03 16:13:07 bjacques Exp $ */
+/* $Id: edit_text_character.cpp,v 1.51 2007/04/03 17:21:38 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1047,12 +1047,38 @@
continue;
}
+ if (code == 9) // tab (ASCII HT)
+ {
+ int index = _font->get_glyph_index(32); // ascii SPACE
+ if ( index == -1 )
+ {
+ log_warning("%s -- missing glyph for space char
(needed for TAB)."
+ " Make sure character shapes for
font %s are being exported "
+ "into your SWF file!",
+ __PRETTY_FUNCTION__,
+ _font->get_name());
+ }
+ else
+ {
+ text_glyph_record::glyph_entry ge;
+ ge.m_glyph_index = index;
+ ge.m_glyph_advance = scale *
_font->get_advance(index);
+
+ const int tabstop=8;
+ rec.m_glyphs.insert(rec.m_glyphs.end(),
tabstop, ge);
+ x += ge.m_glyph_advance*tabstop;
+ }
+ goto after_x_advance;
+ }
+
// Remember where word breaks occur.
if (code == 32)
{
last_space_glyph = rec.m_glyphs.size();
}
+ { // need a sub-scope to avoid the 'goto' in TAB handling to
cross
+ // initialization of the 'index' variable
int index = _font->get_glyph_index((uint16_t) code);
if (index == -1)
{
@@ -1082,7 +1108,9 @@
rec.m_glyphs.push_back(ge);
x += ge.m_glyph_advance;
+ }
+after_x_advance:
if (x >= m_def->width() - m_def->get_right_margin() -
WIDTH_FUDGE)
{
- [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp,
Sandro Santilli <=