FontDemo: Cleanup of previous UTF-8 compliancy fix
Avoid using the private API, rather use the public BString. Thanks mmlr.
This commit is contained in:
parent
6b0362305f
commit
c5e8e32acd
@ -19,8 +19,7 @@
|
||||
#include <Font.h>
|
||||
#include <Message.h>
|
||||
#include <Shape.h>
|
||||
|
||||
#include <utf8_functions.h>
|
||||
#include <String.h>
|
||||
|
||||
#include "messages.h"
|
||||
|
||||
@ -101,7 +100,8 @@ FontDemoView::_DrawView(BView* view)
|
||||
|
||||
view->SetFont(&fFont, B_FONT_ALL);
|
||||
|
||||
const size_t size = UTF8CountChars(fString, -1);
|
||||
BString tmpString(fString);
|
||||
const size_t size = tmpString.CountChars();
|
||||
BRect boundBoxes[size];
|
||||
|
||||
if (OutLineLevel())
|
||||
@ -138,8 +138,6 @@ FontDemoView::_DrawView(BView* view)
|
||||
// region area instead of the whole view.
|
||||
|
||||
fBoxRegion.MakeEmpty();
|
||||
|
||||
char *tmpString = fString;
|
||||
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
xCoordArray[i] = 0.0f;
|
||||
@ -163,10 +161,10 @@ FontDemoView::_DrawView(BView* view)
|
||||
} else {
|
||||
view->SetHighColor(0, 0, 0);
|
||||
view->SetDrawingMode(fDrawingMode);
|
||||
int32 length = UTF8NextCharLen(tmpString);
|
||||
view->DrawString(tmpString, length,
|
||||
int32 charLength;
|
||||
const char* charAt = tmpString.CharAt(i, &charLength);
|
||||
view->DrawString(charAt, charLength,
|
||||
BPoint(xCoordArray[i], yCoordArray[i]));
|
||||
tmpString += length;
|
||||
}
|
||||
|
||||
if (BoundingBoxes() && !OutLineLevel()) {
|
||||
|
@ -2,8 +2,6 @@ SubDir HAIKU_TOP src apps fontdemo ;
|
||||
|
||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||
|
||||
UsePrivateHeaders interface ;
|
||||
|
||||
Application FontDemo :
|
||||
ControlView.cpp
|
||||
FontDemo.cpp
|
||||
|
Loading…
x
Reference in New Issue
Block a user