Add lancelot test for smallcaps text path
Change-Id: I62b824e852fe6c05afabbd7ab80efaad5a298f82 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>bb10
parent
3a8c8e7cf6
commit
6cd1d6e927
|
|
@ -92,6 +92,14 @@ const char *PaintCommands::fontHintingTable[] = {
|
|||
"Full"
|
||||
};
|
||||
|
||||
const char *PaintCommands::fontCapitalizationTable[] = {
|
||||
"MixedCase",
|
||||
"AllUppercase",
|
||||
"AllLowercase",
|
||||
"SmallCaps",
|
||||
"Capitalize"
|
||||
};
|
||||
|
||||
const char *PaintCommands::clipOperationTable[] = {
|
||||
"NoClip",
|
||||
"ReplaceClip",
|
||||
|
|
@ -305,8 +313,8 @@ void PaintCommands::staticInit()
|
|||
"setCompositionMode <composition mode enum>",
|
||||
"setCompositionMode SourceOver");
|
||||
DECL_PAINTCOMMAND("setFont", command_setFont,
|
||||
"^setFont\\s+\"([\\w\\s]*)\"\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$",
|
||||
"setFont <fontFace> [size] [font weight|font weight enum] [italic] [hinting enum] [underline] [strikeout] [overline]\n - font weight is an integer between 0 and 99",
|
||||
"^setFont\\s+\"([\\w\\s]*)\"\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$",
|
||||
"setFont <fontFace> [size] [font weight|font weight enum] [italic] [hinting enum] [underline] [strikeout] [overline] [capitalization enum]\n - font weight is an integer between 0 and 99",
|
||||
"setFont \"times\" 12");
|
||||
DECL_PAINTCOMMAND("setPen", command_setPen,
|
||||
"^setPen\\s+#?(\\w*)$",
|
||||
|
|
@ -2145,6 +2153,12 @@ void PaintCommands::command_setFont(QRegularExpressionMatch re)
|
|||
font.setStrikeOut(strikeOut);
|
||||
font.setOverline(overline);
|
||||
|
||||
int capitalization = translateEnum(fontCapitalizationTable, caps.at(9), 5);
|
||||
if (capitalization == -1)
|
||||
capitalization = 0;
|
||||
else
|
||||
font.setCapitalization(QFont::Capitalization(capitalization));
|
||||
|
||||
if (m_verboseMode)
|
||||
printf(" -(lance) setFont(family=%s, size=%d, weight=%d, italic=%d hinting=%s\n",
|
||||
qPrintable(family), size, weight, italic, fontHintingTable[hinting]);
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ private:
|
|||
static const char *penStyleTable[];
|
||||
static const char *fontWeightTable[];
|
||||
static const char *fontHintingTable[];
|
||||
static const char *fontCapitalizationTable[];
|
||||
static const char *clipOperationTable[];
|
||||
static const char *spreadMethodTable[];
|
||||
static const char *coordinateMethodTable[];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
# Version: 1
|
||||
|
||||
setPen black 1
|
||||
setBrush 7f7fff
|
||||
|
||||
setFont "times" 50 Light false Default false false false SmallCaps
|
||||
path_addText text 0 50 "Hello Qt"
|
||||
|
||||
drawPath text
|
||||
Loading…
Reference in New Issue