Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
5d71559d
Commit
5d71559d
authored
Jun 06, 2003
by
Cyril Deguet
Browse files
* x11/x11_window.cpp: fixed clipping and text attributes
parent
12d6fe8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/gui/skins/x11/x11_font.cpp
View file @
5d71559d
...
...
@@ -2,7 +2,7 @@
* x11_font.cpp: X11 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_font.cpp,v 1.
5
2003/06/0
1
2
2:11:24
asmax Exp $
* $Id: x11_font.cpp,v 1.
6
2003/06/0
6
2
1:47:18
asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -47,10 +47,18 @@ X11Font::X11Font( intf_thread_t *_p_intf, string fontname, int size,
:
SkinFont
(
_p_intf
,
fontname
,
size
,
color
,
weight
,
italic
,
underline
)
{
display
=
g_pIntf
->
p_sys
->
display
;
Underline
=
underline
;
char
name
[
256
];
char
slant
=
(
italic
?
'i'
:
'r'
);
// FIXME: a lot of work...
size
=
(
size
<
10
?
8
:
12
);
snprintf
(
name
,
256
,
"-*-helvetica-bold-%c-*-*-*-%i-*-*-*-*-*-*"
,
slant
,
10
*
size
);
msg_Warn
(
_p_intf
,
"loading font %s"
,
name
);
// FIXME: just a beginning...
XLOCK
;
font
=
XLoadFont
(
display
,
"-misc-fixed-*-*-*-*-*-*-*-*-*-*-*-*"
);
font
=
XLoadFont
(
display
,
name
);
XUNLOCK
;
}
//---------------------------------------------------------------------------
...
...
@@ -84,14 +92,29 @@ void X11Font::GenericPrint( Graphics *dest, string text, int x, int y,
GC
gc
=
(
(
X11Graphics
*
)
dest
)
->
GetGC
();
XGCValues
gcVal
;
// Change color to avoid transparency
gcVal
.
foreground
=
(
color
==
0
?
10
:
color
);
gcVal
.
font
=
font
;
// Render text on buffer
XRectangle
rect
;
rect
.
x
=
x
;
rect
.
y
=
y
;
rect
.
width
=
w
;
rect
.
height
=
h
+
1
;
XLOCK
;
XChangeGC
(
display
,
gc
,
GCForeground
|
GCFont
,
&
gcVal
);
XDrawString
(
display
,
drawable
,
gc
,
x
,
y
+
h
,
text
.
c_str
(),
text
.
size
());
XChangeGC
(
display
,
gc
,
GCForeground
|
GCFont
,
&
gcVal
);
// Set the clipping region
XSetClipRectangles
(
display
,
gc
,
0
,
0
,
&
rect
,
1
,
Unsorted
);
// Render text no the drawable
XDrawString
(
display
,
drawable
,
gc
,
x
,
y
+
h
,
text
.
c_str
(),
text
.
size
());
if
(
Underline
)
{
XDrawLine
(
display
,
drawable
,
gc
,
x
,
y
+
h
,
x
+
w
,
y
+
h
);
}
// Reset the clip mask
XSetClipMask
(
display
,
gc
,
None
);
XUNLOCK
;
}
...
...
modules/gui/skins/x11/x11_font.h
View file @
5d71559d
...
...
@@ -2,7 +2,7 @@
* x11_font.h: X11 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_font.h,v 1.
2
2003/06/0
1 16:39:49
asmax Exp $
* $Id: x11_font.h,v 1.
3
2003/06/0
6 21:47:18
asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -43,6 +43,7 @@ class X11Font : SkinFont
private:
Display
*
display
;
Font
font
;
bool
Underline
;
// Assign font to Device Context
virtual
void
AssignFont
(
Graphics
*
dest
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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