Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
48c0c664
Commit
48c0c664
authored
Oct 12, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add a helper to find a font in the font table.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
074fafab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
writer.c
dlls/riched20/writer.c
+28
-15
No files found.
dlls/riched20/writer.c
View file @
48c0c664
...
@@ -237,6 +237,31 @@ static void add_font_to_fonttbl( ME_OutStream *stream, ME_Style *style )
...
@@ -237,6 +237,31 @@ static void add_font_to_fonttbl( ME_OutStream *stream, ME_Style *style )
}
}
}
}
static
BOOL
find_font_in_fonttbl
(
ME_OutStream
*
stream
,
CHARFORMAT2W
*
fmt
,
unsigned
int
*
idx
)
{
WCHAR
*
facename
;
int
i
;
*
idx
=
0
;
if
(
fmt
->
dwMask
&
CFM_FACE
)
facename
=
fmt
->
szFaceName
;
else
facename
=
stream
->
fonttbl
[
0
].
szFaceName
;
for
(
i
=
0
;
i
<
stream
->
nFontTblLen
;
i
++
)
{
if
(
facename
==
stream
->
fonttbl
[
i
].
szFaceName
||
!
lstrcmpW
(
facename
,
stream
->
fonttbl
[
i
].
szFaceName
))
if
(
!
(
fmt
->
dwMask
&
CFM_CHARSET
)
||
fmt
->
bCharSet
==
stream
->
fonttbl
[
i
].
bCharSet
)
{
*
idx
=
i
;
break
;
}
}
return
i
<
stream
->
nFontTblLen
;
}
static
void
add_color_to_colortbl
(
ME_OutStream
*
stream
,
COLORREF
color
)
static
void
add_color_to_colortbl
(
ME_OutStream
*
stream
,
COLORREF
color
)
{
{
int
i
;
int
i
;
...
@@ -713,21 +738,9 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
...
@@ -713,21 +738,9 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
}
}
/* FIXME: How to emit CFM_WEIGHT? */
/* FIXME: How to emit CFM_WEIGHT? */
if
(
fmt
->
dwMask
&
CFM_FACE
||
fmt
->
dwMask
&
CFM_CHARSET
)
{
if
(
fmt
->
dwMask
&
CFM_FACE
||
fmt
->
dwMask
&
CFM_CHARSET
)
WCHAR
*
szFaceName
;
{
if
(
find_font_in_fonttbl
(
pStream
,
fmt
,
&
i
))
if
(
fmt
->
dwMask
&
CFM_FACE
)
szFaceName
=
fmt
->
szFaceName
;
else
szFaceName
=
pStream
->
fonttbl
[
0
].
szFaceName
;
for
(
i
=
0
;
i
<
pStream
->
nFontTblLen
;
i
++
)
{
if
(
szFaceName
==
pStream
->
fonttbl
[
i
].
szFaceName
||
!
lstrcmpW
(
szFaceName
,
pStream
->
fonttbl
[
i
].
szFaceName
))
if
(
!
(
fmt
->
dwMask
&
CFM_CHARSET
)
||
fmt
->
bCharSet
==
pStream
->
fonttbl
[
i
].
bCharSet
)
break
;
}
if
(
i
<
pStream
->
nFontTblLen
)
{
{
if
(
i
!=
pStream
->
nDefaultFont
)
if
(
i
!=
pStream
->
nDefaultFont
)
sprintf
(
props
+
strlen
(
props
),
"
\\
f%u"
,
i
);
sprintf
(
props
+
strlen
(
props
),
"
\\
f%u"
,
i
);
...
...
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