From fb78ca8a62c69a51903416f5a4062a8972c1e98d Mon Sep 17 00:00:00 2001 From: Darkvater Date: Mon, 21 Feb 2005 18:59:54 +0000 Subject: (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes - Codechange: Introduction of Textbuf struct which not only holds physical data as length but also pixel-constrains (width) and information about the caret - Codechange: Move Clipboard function to OS specific file. Currently only Windows has clipboard actions - Feature: Editboxes, console and exit screen also accept the numeric-enter as a yes - Feature: Navigation through text with cursor keys is possible, as well as arbitrary insertion (also paste) and deletion; both backspace and del keys. Functions DeleteTextBufferChar, InsertTextBufferChar and InsertTextBufferClipboard handle input and deletion. Navigation is done through MoveTextBufferPos. - Fix: OTTD crash when opening 'add server' editbox - CodeChange: fix up some stringwidth calculations in gfx.c. You can get the width in pixels of a character by calling GetCharacterWidth(). --- news_gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'news_gui.c') diff --git a/news_gui.c b/news_gui.c index 608b3e9d1..1f22f6078 100644 --- a/news_gui.c +++ b/news_gui.c @@ -539,7 +539,7 @@ static void GetNewsString(NewsItem *ni, char *buffer, uint max) d[0] = d[1] = d[2] = d[3] = ' '; d += 4; } else if ((byte)*s >= ' ' && ((byte)*s < 0x88 || (byte)*s >= 0x99)) { - len += _stringwidth_table[(byte)*s - 32]; + len += GetCharacterWidth((byte)*s); *d++ = *s; } } -- cgit v1.2.3-54-g00ecf