Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ad58ca23
Commit
ad58ca23
authored
Dec 13, 2011
by
Kusanagi Kouichi
Committed by
Alexandre Julliard
Dec 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Add tests for vertical font.
parent
3caf2876
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
304 additions
and
3 deletions
+304
-3
font.c
dlls/gdi32/tests/font.c
+101
-3
resource.rc
dlls/gdi32/tests/resource.rc
+4
-0
vertical.sfd
dlls/gdi32/tests/vertical.sfd
+199
-0
vertical.ttf
dlls/gdi32/tests/vertical.ttf
+0
-0
No files found.
dlls/gdi32/tests/font.c
View file @
ad58ca23
...
@@ -3870,7 +3870,7 @@ static void test_fullname(void)
...
@@ -3870,7 +3870,7 @@ static void test_fullname(void)
DeleteDC
(
hdc
);
DeleteDC
(
hdc
);
}
}
static
BOOL
write_ttf_file
(
char
*
tmp_name
)
static
BOOL
write_ttf_file
(
c
onst
char
*
fontname
,
c
har
*
tmp_name
)
{
{
char
tmp_path
[
MAX_PATH
];
char
tmp_path
[
MAX_PATH
];
HRSRC
rsrc
;
HRSRC
rsrc
;
...
@@ -3880,7 +3880,7 @@ static BOOL write_ttf_file(char *tmp_name)
...
@@ -3880,7 +3880,7 @@ static BOOL write_ttf_file(char *tmp_name)
BOOL
ret
;
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
rsrc
=
FindResource
(
GetModuleHandle
(
0
),
"wine_test.ttf"
,
RT_RCDATA
);
rsrc
=
FindResource
(
GetModuleHandle
(
0
),
fontname
,
RT_RCDATA
);
ok
(
rsrc
!=
0
,
"FindResource error %d
\n
"
,
GetLastError
());
ok
(
rsrc
!=
0
,
"FindResource error %d
\n
"
,
GetLastError
());
if
(
!
rsrc
)
return
FALSE
;
if
(
!
rsrc
)
return
FALSE
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -3926,7 +3926,7 @@ static void test_CreateScalableFontResource(void)
...
@@ -3926,7 +3926,7 @@ static void test_CreateScalableFontResource(void)
return
;
return
;
}
}
if
(
!
write_ttf_file
(
ttf_name
))
if
(
!
write_ttf_file
(
"wine_test.ttf"
,
ttf_name
))
{
{
skip
(
"Failed to create ttf file for testing
\n
"
);
skip
(
"Failed to create ttf file for testing
\n
"
);
return
;
return
;
...
@@ -4054,6 +4054,103 @@ todo_wine
...
@@ -4054,6 +4054,103 @@ todo_wine
DeleteFile
(
ttf_name
);
DeleteFile
(
ttf_name
);
}
}
static
void
check_vertical_font
(
const
char
*
name
,
BOOL
*
installed
,
BOOL
*
selected
,
GLYPHMETRICS
*
gm
)
{
LOGFONTA
lf
;
HFONT
hfont
,
hfont_prev
;
HDC
hdc
;
char
facename
[
100
];
DWORD
ret
;
*
installed
=
is_truetype_font_installed
(
name
);
lf
.
lfHeight
=
-
18
;
lf
.
lfWidth
=
0
;
lf
.
lfEscapement
=
0
;
lf
.
lfOrientation
=
0
;
lf
.
lfWeight
=
FW_DONTCARE
;
lf
.
lfItalic
=
0
;
lf
.
lfUnderline
=
0
;
lf
.
lfStrikeOut
=
0
;
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
lf
.
lfOutPrecision
=
OUT_TT_ONLY_PRECIS
;
lf
.
lfClipPrecision
=
CLIP_DEFAULT_PRECIS
;
lf
.
lfQuality
=
DEFAULT_QUALITY
;
lf
.
lfPitchAndFamily
=
DEFAULT_PITCH
|
FF_DONTCARE
;
strcpy
(
lf
.
lfFaceName
,
name
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
NULL
,
"CreateFontIndirectA failed
\n
"
);
hdc
=
GetDC
(
NULL
);
hfont_prev
=
SelectObject
(
hdc
,
hfont
);
ok
(
hfont_prev
!=
NULL
,
"SelectObject failed
\n
"
);
ret
=
GetTextFaceA
(
hdc
,
sizeof
facename
,
facename
);
ok
(
ret
,
"GetTextFaceA failed
\n
"
);
*
selected
=
!
strcmp
(
facename
,
name
);
ret
=
GetGlyphOutlineW
(
hdc
,
0x2025
,
GGO_METRICS
,
gm
,
0
,
NULL
,
&
mat
);
ok
(
ret
!=
GDI_ERROR
,
"GetGlyphOutlineW failed
\n
"
);
if
(
!*
selected
)
memset
(
gm
,
0
,
sizeof
*
gm
);
SelectObject
(
hdc
,
hfont_prev
);
DeleteObject
(
hfont
);
ReleaseDC
(
NULL
,
hdc
);
}
static
void
test_vertical_font
(
void
)
{
char
ttf_name
[
MAX_PATH
];
int
num
;
BOOL
ret
,
installed
,
selected
;
GLYPHMETRICS
gm
;
if
(
!
pAddFontResourceExA
||
!
pRemoveFontResourceExA
)
{
win_skip
(
"AddFontResourceExA is not available on this platform
\n
"
);
return
;
}
if
(
!
write_ttf_file
(
"vertical.ttf"
,
ttf_name
))
{
skip
(
"Failed to create ttf file for testing
\n
"
);
return
;
}
num
=
pAddFontResourceExA
(
ttf_name
,
FR_PRIVATE
,
0
);
todo_wine
ok
(
num
==
2
,
"AddFontResourceExA should add 2 fonts from vertical.ttf
\n
"
);
check_vertical_font
(
"@WineTestVertical"
,
&
installed
,
&
selected
,
&
gm
);
/* This test fails on wine if locale is not en-US. Disable for now. */
if
(
0
)
ok
(
installed
,
"@WineTestVertical is not installed
\n
"
);
todo_wine
ok
(
selected
,
"@WineTestVertical is not selected
\n
"
);
todo_wine
ok
(
gm
.
gmBlackBoxX
>
gm
.
gmBlackBoxY
,
"gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
check_vertical_font
(
"@@WineTestVertical"
,
&
installed
,
&
selected
,
&
gm
);
todo_wine
ok
(
installed
,
"@@WineTestVertical is not installed
\n
"
);
todo_wine
ok
(
selected
,
"@@WineTestVertical is not selected
\n
"
);
todo_wine
ok
(
gm
.
gmBlackBoxX
<
gm
.
gmBlackBoxY
,
"gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
ret
=
pRemoveFontResourceExA
(
ttf_name
,
FR_PRIVATE
,
0
);
ok
(
ret
,
"RemoveFontResourceEx() error %d
\n
"
,
GetLastError
());
DeleteFile
(
ttf_name
);
}
START_TEST
(
font
)
START_TEST
(
font
)
{
{
init
();
init
();
...
@@ -4107,6 +4204,7 @@ START_TEST(font)
...
@@ -4107,6 +4204,7 @@ START_TEST(font)
test_oemcharset
();
test_oemcharset
();
test_fullname
();
test_fullname
();
test_vertical_font
();
/* CreateScalableFontResource should be last test until RemoveFontResource
/* CreateScalableFontResource should be last test until RemoveFontResource
* is properly implemented.
* is properly implemented.
*/
*/
...
...
dlls/gdi32/tests/resource.rc
View file @
ad58ca23
...
@@ -22,3 +22,7 @@
...
@@ -22,3 +22,7 @@
/* @makedep: wine_test.ttf */
/* @makedep: wine_test.ttf */
wine_test.ttf RCDATA wine_test.ttf
wine_test.ttf RCDATA wine_test.ttf
/* @makedep: vertical.ttf */
vertical.ttf RCDATA vertical.ttf
dlls/gdi32/tests/vertical.sfd
0 → 100644
View file @
ad58ca23
SplineFontDB: 3.0
FontName: mplus-1p-regular
FullName: M+ 1p regular
FamilyName: M+ 1p regular
Weight: Book
Copyright: Copyright(c) 2011 M+ FONTS PROJECT
Version: 1.044
ItalicAngle: 0
UnderlinePosition: -100
UnderlineWidth: 50
Ascent: 860
Descent: 140
sfntRevision: 0x00010b43
LayerCount: 2
Layer: 0 1 "Back" 1
Layer: 1 1 "Fore" 0
NeedsXUIDChange: 1
XUID: [1021 311 1688707159 7641229]
FSType: 0
OS2Version: 1
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1314095750
ModificationTime: 1323339383
PfmFamily: 17
TTFWeight: 400
TTFWidth: 5
LineGap: 90
VLineGap: 0
Panose: 2 11 5 2 2 2 3 2 2 7
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 90
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: -23
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 23
HheadDOffset: 1
OS2SubXSize: 650
OS2SubYSize: 700
OS2SubXOff: 0
OS2SubYOff: 140
OS2SupXSize: 650
OS2SupYSize: 700
OS2SupXOff: 0
OS2SupYOff: 480
OS2StrikeYSize: 49
OS2StrikeYPos: 258
OS2FamilyClass: 2054
OS2Vendor: 'M+ '
OS2CodePages: 601201bf.dff70000
OS2UnicodeRanges: e1000aff.4a47fdfb.02000012.00000000
Lookup: 4 0 1 "kana semi-voiced lookup" {"kana semi-voiced table" } ['ccmp' ('kana' <'dflt' > ) 'liga' ('kana' <'dflt' > ) ]
Lookup: 1 0 0 "gsubvert" {"j-vert" } ['vert' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
Lookup: 4 0 1 "ligalookup01" {"ligalookup01 subtable" } ['liga' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 4 0 0 "ccmplookup01" {"ccmplookup01 subtable" } ['ccmp' ('hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ]
Lookup: 4 0 0 "ccmplookup02" {"ccmplookup02 subtable" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 1 0 0 "SingleSubstitutionlookupDotless" {"SingleSubstitutionlookupDotless subtable" } []
Lookup: 6 0 0 "ccmplookup03" {"ccmplookup03 contextual 0" "ccmplookup03 contextual 1" "ccmplookup03 contextual 2" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 258 0 0 "kerning pairs" {"kp" } ['kern' ('latn' <'dflt' > ) ]
Lookup: 262 4 0 "mkmklookup1" {"mkmklookup1 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 260 4 0 "marklookup2" {"marklookup2 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 260 4 0 "marklookup1" {"marklookup1 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ]
Lookup: 262 4 0 "mkmklookup2" {"mkmklookup2 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ]
DEI: 91125
ChainSub2: coverage "ccmplookup03 contextual 2" 0 0 0 1
1 0 3
Coverage: 19 i j uni0249 uni03F3
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
1
SeqLookup: 0 "SingleSubstitutionlookupDotless"
EndFPST
ChainSub2: coverage "ccmplookup03 contextual 1" 0 0 0 1
1 0 2
Coverage: 19 i j uni0249 uni03F3
FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
1
SeqLookup: 0 "SingleSubstitutionlookupDotless"
EndFPST
ChainSub2: coverage "ccmplookup03 contextual 0" 0 0 0 1
1 0 1
Coverage: 19 i j uni0249 uni03F3
FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486
1
SeqLookup: 0 "SingleSubstitutionlookupDotless"
EndFPST
MacFeat: 0 0 0
MacName: 0 0 24 "All Typographic Features"
MacName: 0 1 24 "Fonctions typographiques"
MacName: 0 2 33 "Alle typografischen M\232glichkeiten"
MacName: 0 3 21 "Funzioni Tipografiche"
MacName: 0 4 28 "Alle typografische kenmerken"
MacSetting: 0
MacName: 0 0 17 "All Type Features"
MacName: 0 1 31 "Toutes fonctions typographiques"
MacName: 0 2 23 "Alle Auszeichnungsarten"
MacName: 0 3 17 "Tutte le Funzioni"
MacName: 0 4 18 "Alle typekenmerken"
MacFeat: 1 0 0
MacName: 0 0 9 "Ligatures"
MacName: 0 1 9 "Ligatures"
MacName: 0 2 9 "Ligaturen"
MacName: 0 3 8 "Legature"
MacName: 0 4 9 "Ligaturen"
MacSetting: 2
MacName: 0 0 16 "Common Ligatures"
MacName: 0 1 18 "Ligatures Usuelles"
MacName: 0 2 17 "Normale Ligaturen"
MacName: 0 3 19 "Legature pi\235 Comuni"
MacName: 0 4 28 "Gemeenschappelijke Ligaturen"
EndMacFeatures
TtTable: prep
PUSHW_2
511
0
SCANTYPE
SCANCTRL
EndTTInstrs
ShortTable: maxp 16
1
0
6439
216
18
0
0
2
0
0
0
0
4
0
0
0
EndShort
LangName: 1033 "" "@WineTestVertical" "Regular" "FontForge 2.0 : M+- 1p regular : 2-11-2011" "" "" "" "" "" "" "" "http://mplus-fonts.sourceforge.jp" "" "" "" "" "M+- 1p" "regular"
GaspTable: 1 65535 2
Encoding: UnicodeFull
UnicodeInterp: none
NameList: Adobe Glyph List
DisplaySize: -24
AntiAlias: 1
FitToEm: 1
AnchorClass2: "TopMark" "mkmklookup1 subtable" "Bottom" "marklookup2 subtable" "Top" "marklookup1 subtable" "BottomMark" "mkmklookup2 subtable"
BeginChars: 1114185 2
StartChar: twodotenleader
Encoding: 8229 8229 0
Width: 1000
GlyphClass: 2
Flags: W
LayerCount: 2
Fore
SplineSet
703 290 m 1,0,-1
703 430 l 1,1,-1
797 430 l 1,2,-1
797 290 l 1,3,-1
703 290 l 1,0,-1
203 290 m 1,4,-1
203 430 l 1,5,-1
297 430 l 1,6,-1
297 290 l 1,7,-1
203 290 l 1,4,-1
EndSplineSet
Substitution2: "j-vert" twodotenleader.vert
EndChar
StartChar: twodotenleader.vert
Encoding: 1114131 -1 1
Width: 1000
GlyphClass: 2
Flags: W
LayerCount: 2
Fore
SplineSet
453 540 m 1,0,-1
453 680 l 1,1,-1
547 680 l 1,2,-1
547 540 l 1,3,-1
453 540 l 1,0,-1
453 40 m 1,4,-1
453 180 l 1,5,-1
547 180 l 1,6,-1
547 40 l 1,7,-1
453 40 l 1,4,-1
EndSplineSet
EndChar
EndChars
EndSplineFont
dlls/gdi32/tests/vertical.ttf
0 → 100644
View file @
ad58ca23
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment