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
51ec927c
Commit
51ec927c
authored
Feb 24, 2004
by
Lionel Ulmer
Committed by
Alexandre Julliard
Feb 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix 'empty' glyphs
- implement proper bitmap coordinates
parent
1a87dc42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
30 deletions
+39
-30
wgl.c
dlls/opengl32/wgl.c
+39
-30
No files found.
dlls/opengl32/wgl.c
View file @
51ec927c
...
@@ -534,15 +534,12 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc,
...
@@ -534,15 +534,12 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc,
int
needed_size
=
GetGlyphOutline_ptr
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
0
,
NULL
,
NULL
);
int
needed_size
=
GetGlyphOutline_ptr
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
0
,
NULL
,
NULL
);
int
height
,
width_int
;
int
height
,
width_int
;
TRACE
(
"Glyph : %
d
\n
"
,
glyph
);
TRACE
(
"Glyph : %
3d / List : %ld
\n
"
,
glyph
,
listBase
);
if
(
needed_size
==
GDI_ERROR
)
{
if
(
needed_size
==
GDI_ERROR
)
{
TRACE
(
" - needed size : %d (GDI_ERROR)
\n
"
,
needed_size
);
TRACE
(
" - needed size : %d (GDI_ERROR)
\n
"
,
needed_size
);
goto
error
;
goto
error
;
}
else
{
}
else
{
TRACE
(
" - needed size : %d
\n
"
,
needed_size
);
TRACE
(
" - needed size : %d
\n
"
,
needed_size
);
if
(
needed_size
==
0
)
{
continue
;
}
}
}
if
(
needed_size
>
size
)
{
if
(
needed_size
>
size
)
{
...
@@ -557,42 +554,54 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc,
...
@@ -557,42 +554,54 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc,
unsigned
int
height
,
width
,
bitmask
;
unsigned
int
height
,
width
,
bitmask
;
unsigned
char
*
bitmap_
=
(
unsigned
char
*
)
bitmap
;
unsigned
char
*
bitmap_
=
(
unsigned
char
*
)
bitmap
;
DPRINTF
(
" - bbox : %d x %d
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
TRACE
(
" - bbox : %d x %d
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
DPRINTF
(
" - origin : (%ld , %ld)
\n
"
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmptGlyphOrigin
.
y
);
TRACE
(
" - origin : (%ld , %ld)
\n
"
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmptGlyphOrigin
.
y
);
DPRINTF
(
" - increment : %d - %d
\n
"
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
);
TRACE
(
" - increment : %d - %d
\n
"
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
);
DPRINTF
(
" - bitmap :
\n
"
);
if
(
needed_size
!=
0
)
{
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
TRACE
(
" - bitmap :
\n
"
);
DPRINTF
(
" "
);
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
for
(
width
=
0
,
bitmask
=
0x80
;
width
<
gm
.
gmBlackBoxX
;
width
++
,
bitmask
>>=
1
)
{
TRACE
(
" "
);
if
(
bitmask
==
0
)
{
for
(
width
=
0
,
bitmask
=
0x80
;
width
<
gm
.
gmBlackBoxX
;
width
++
,
bitmask
>>=
1
)
{
bitmap_
+=
1
;
if
(
bitmask
==
0
)
{
bitmask
=
0x80
;
bitmap_
+=
1
;
bitmask
=
0x80
;
}
if
(
*
bitmap_
&
bitmask
)
DPRINTF
(
"*"
);
else
DPRINTF
(
" "
);
}
}
if
(
*
bitmap_
&
bitmask
)
bitmap_
+=
(
4
-
(((
unsigned
int
)
bitmap_
)
&
0x03
));
DPRINTF
(
"*"
);
DPRINTF
(
"
\n
"
);
else
DPRINTF
(
" "
);
}
}
bitmap_
+=
(
4
-
(((
unsigned
int
)
bitmap_
)
&
0x03
));
DPRINTF
(
"
\n
"
);
}
}
}
}
/* For some obscure reasons, I seem to need to rotate the glyph for OpenGL to be happy.
/* In OpenGL, the bitmap is drawn from the bottom to the top... So we need to invert the
As Wine does not seem to support the MAT2 field, I need to do it myself.... */
* glyph for it to be drawn properly.
width_int
=
(
gm
.
gmBlackBoxX
+
31
)
/
32
;
*/
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
if
(
needed_size
!=
0
)
{
int
width
;
width_int
=
(
gm
.
gmBlackBoxX
+
31
)
/
32
;
for
(
width
=
0
;
width
<
width_int
;
width
++
)
{
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
((
int
*
)
gl_bitmap
)[(
gm
.
gmBlackBoxY
-
height
-
1
)
*
width_int
+
width
]
=
int
width
;
((
int
*
)
bitmap
)[
height
*
width_int
+
width
];
for
(
width
=
0
;
width
<
width_int
;
width
++
)
{
((
int
*
)
gl_bitmap
)[(
gm
.
gmBlackBoxY
-
height
-
1
)
*
width_int
+
width
]
=
((
int
*
)
bitmap
)[
height
*
width_int
+
width
];
}
}
}
}
}
ENTER_GL
();
ENTER_GL
();
glNewList
(
listBase
++
,
GL_COMPILE
);
glNewList
(
listBase
++
,
GL_COMPILE
);
glBitmap
(
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
,
gm
.
gmptGlyphOrigin
.
x
,
if
(
needed_size
!=
0
)
{
gm
.
gmBlackBoxY
-
gm
.
gmptGlyphOrigin
.
y
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
,
gl_bitmap
);
glBitmap
(
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
,
0
-
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmBlackBoxY
-
gm
.
gmptGlyphOrigin
.
y
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
,
gl_bitmap
);
}
else
{
/* This is the case of 'empty' glyphs like the space character */
glBitmap
(
0
,
0
,
0
,
0
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
,
NULL
);
}
glEndList
();
glEndList
();
LEAVE_GL
();
LEAVE_GL
();
}
}
...
...
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