Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/functions/Function_Font.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function string_height(_text) {
// #############################################################################################
function string_width(_text) {
g_pFontManager.SetFont();
return g_pFontManager.thefont ? g_pFontManager.thefont.TextWidth(yyGetString(_text)) : 1;
return g_pFontManager.thefont ? g_pFontManager.thefont.TextWidth(yyGetString(_text), undefined, 0) : 1;
}


Expand Down
6 changes: 3 additions & 3 deletions scripts/yyFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ yyFont.prototype.Draw_String_GL = function (_x, _y, _pStr, _xscale, _yscale, _an

var bLerp=false;
if ( (_col1 != _col2) || (_col3 != _col4) ) {
var strWidth = this.TextWidth(_pStr, true,0);
var strWidth = this.TextWidth(_pStr, true, 0);
var invStrWidth = 1/strWidth;
var alpha = _col1 & 0xff000000;
bLerp = true;
Expand Down Expand Up @@ -2488,8 +2488,8 @@ yyFontManager.prototype.GR_Text_Draw = function (_str, x, y, linesep, linewidth,

if (pStr != null)
{
if (this.halign == 1) xoff = -(xscale * thefont.TextWidth(pStr, true,0) / 2);
if (this.halign == 2) xoff = -(xscale * thefont.TextWidth(pStr, true,0));
if (this.halign == 1) xoff = -(xscale * thefont.TextWidth(pStr, true, 0) / 2);
if (this.halign == 2) xoff = -(xscale * thefont.TextWidth(pStr, true, 0));

var xx = passx + (cc * xoff) + (ss * yoff);
var yy = passy - (ss * xoff) + (cc * yoff);
Expand Down