Merge remote-tracking branch 'origin/master' into vulkan2

This commit is contained in:
Rachael Alexanderson 2019-04-14 06:12:32 -04:00
commit b8dfb3c136
73 changed files with 398 additions and 191 deletions

View file

@ -545,6 +545,8 @@ bool DFrameBuffer::ParseDrawTextureTags(FTexture *img, double x, double y, uint3
parms->srcwidth = 1.;
parms->srcheight = 1.;
parms->burn = false;
parms->monospace = EMonospacing::Off;
parms->spacing = 0;
// Parse the tag list for attributes. (For floating point attributes,
// consider that the C ABI dictates that all floats be promoted to
@ -896,7 +898,15 @@ bool DFrameBuffer::ParseDrawTextureTags(FTexture *img, double x, double y, uint3
case DTA_CellY:
parms->celly = ListGetInt(tags);
break;
case DTA_Monospace:
parms->monospace = ListGetInt(tags);
break;
case DTA_Spacing:
parms->spacing = ListGetInt(tags);
break;
case DTA_Burn:
parms->burn = true;
break;

View file

@ -296,6 +296,11 @@ void DFrameBuffer::DrawTextCommon(FFont *font, int normalcolor, double x, double
cx = x;
cy = y;
if (parms.monospace == EMonospacing::CellCenter)
cx += parms.spacing / 2;
else if (parms.monospace == EMonospacing::CellRight)
cx += parms.spacing;
auto currentcolor = normalcolor;
while (ch - string < parms.maxstrlen)
@ -334,9 +339,24 @@ void DFrameBuffer::DrawTextCommon(FFont *font, int normalcolor, double x, double
parms.destwidth = parms.cellx;
parms.destheight = parms.celly;
}
if (parms.monospace == EMonospacing::CellLeft)
parms.left = 0;
else if (parms.monospace == EMonospacing::CellCenter)
parms.left = w / 2.;
else if (parms.monospace == EMonospacing::CellRight)
parms.left = w;
DrawTextureParms(pic, parms);
}
cx += (w + kerning) * parms.scalex;
if (parms.monospace == EMonospacing::Off)
{
cx += (w + kerning + parms.spacing) * parms.scalex;
}
else
{
cx += (parms.spacing) * parms.scalex;
}
}
}