|
|
@@ -36,77 +36,77 @@ RasterFont font_getDefault() {
|
|
|
|
|
|
RasterFont font_createLatinOne(const String& name, const ImageU8& atlas) {
|
|
|
if (!image_exists(atlas)) {
|
|
|
- throwError("Cannot create the Latin-1 font called ", name, " from an empty image handle.\n");
|
|
|
+ throwError(U"Cannot create the Latin-1 font called ", name, U" from an empty image handle.\n");
|
|
|
} else if (image_getWidth(atlas) % 16 == 0 && image_getHeight(atlas) % 16 == 0
|
|
|
&& image_getWidth(atlas) >= 16 && image_getHeight(atlas) >= 16) {
|
|
|
- throwError("Cannot create the Latin-1 font called ", name, " from an image of ", image_getWidth(atlas), "x", image_getHeight(atlas), " pixels.\n");
|
|
|
+ throwError(U"Cannot create the Latin-1 font called ", name, U" from an image of ", image_getWidth(atlas), U"x", image_getHeight(atlas), U" pixels.\n");
|
|
|
}
|
|
|
return RasterFontImpl::createLatinOne(name, atlas);
|
|
|
}
|
|
|
|
|
|
String font_getName(const RasterFont font) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getName: font must exist!");
|
|
|
+ throwError(U"font_getName: font must exist!");
|
|
|
}
|
|
|
return font->name;
|
|
|
}
|
|
|
|
|
|
int32_t font_getSize(const RasterFont font) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getSize: font must exist!");
|
|
|
+ throwError(U"font_getSize: font must exist!");
|
|
|
}
|
|
|
return font->size;
|
|
|
}
|
|
|
|
|
|
int32_t font_getSpacing(const RasterFont font) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getSpacing: font must exist!");
|
|
|
+ throwError(U"font_getSpacing: font must exist!");
|
|
|
}
|
|
|
return font->spacing;
|
|
|
}
|
|
|
|
|
|
int32_t font_getTabWidth(const RasterFont font) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getTabWidth: font must exist!");
|
|
|
+ throwError(U"font_getTabWidth: font must exist!");
|
|
|
}
|
|
|
return font->tabWidth;
|
|
|
}
|
|
|
|
|
|
int32_t font_getCharacterWidth(const RasterFont font, DsrChar unicodeValue) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getCharacterWidth: font must exist!");
|
|
|
+ throwError(U"font_getCharacterWidth: font must exist!");
|
|
|
}
|
|
|
return font->getCharacterWidth(unicodeValue);
|
|
|
}
|
|
|
|
|
|
int32_t font_getMonospaceWidth(const RasterFont font) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getMonospaceWidth: font must exist!");
|
|
|
+ throwError(U"font_getMonospaceWidth: font must exist!");
|
|
|
}
|
|
|
return font->widest + font->spacing;
|
|
|
}
|
|
|
|
|
|
int32_t font_getLineWidth(const RasterFont font, const ReadableString& content) {
|
|
|
if (!font_exists(font)) {
|
|
|
- throwError("font_getLineWidth: font must exist!");
|
|
|
+ throwError(U"font_getLineWidth: font must exist!");
|
|
|
}
|
|
|
return font->getLineWidth(content);
|
|
|
}
|
|
|
|
|
|
int32_t font_printCharacter(ImageRgbaU8& target, const RasterFont font, DsrChar unicodeValue, const IVector2D& location, const ColorRgbaI32& color) {
|
|
|
if (!image_exists(target)) {
|
|
|
- throwError("font_printCharacter: target must exist!");
|
|
|
+ throwError(U"font_printCharacter: target must exist!");
|
|
|
} else if (!font_exists(font)) {
|
|
|
- throwError("font_printCharacter: font must exist!");
|
|
|
+ throwError(U"font_printCharacter: font must exist!");
|
|
|
}
|
|
|
return font->printCharacter(target, unicodeValue, location, color);
|
|
|
}
|
|
|
|
|
|
void font_printLine(ImageRgbaU8& target, const RasterFont font, const ReadableString& content, const IVector2D& location, const ColorRgbaI32& color) {
|
|
|
if (!image_exists(target)) {
|
|
|
- throwError("font_printLine: target must exist!");
|
|
|
+ throwError(U"font_printLine: target must exist!");
|
|
|
} else if (!font_exists(font)) {
|
|
|
- throwError("font_printLine: font must exist!");
|
|
|
+ throwError(U"font_printLine: font must exist!");
|
|
|
} else {
|
|
|
font->printLine(target, content, location, color);
|
|
|
}
|
|
|
@@ -114,9 +114,9 @@ void font_printLine(ImageRgbaU8& target, const RasterFont font, const ReadableSt
|
|
|
|
|
|
void font_printMultiLine(ImageRgbaU8& target, const RasterFont font, const ReadableString& content, const IRect& bound, const ColorRgbaI32& color) {
|
|
|
if (!image_exists(target)) {
|
|
|
- throwError("font_printMultiLine: target must exist!");
|
|
|
+ throwError(U"font_printMultiLine: target must exist!");
|
|
|
} else if (!font_exists(font)) {
|
|
|
- throwError("font_printMultiLine: font must exist!");
|
|
|
+ throwError(U"font_printMultiLine: font must exist!");
|
|
|
} else {
|
|
|
font->printMultiLine(target, content, bound, color);
|
|
|
}
|