Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
5d71559d
Commit
5d71559d
authored
Jun 06, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* x11/x11_window.cpp: fixed clipping and text attributes
parent
12d6fe8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
9 deletions
+33
-9
modules/gui/skins/x11/x11_font.cpp
modules/gui/skins/x11/x11_font.cpp
+31
-8
modules/gui/skins/x11/x11_font.h
modules/gui/skins/x11/x11_font.h
+2
-1
No files found.
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/01 22:11:24
asmax Exp $
* $Id: x11_font.cpp,v 1.
6 2003/06/06 21: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/01 16:39:49
asmax Exp $
* $Id: x11_font.h,v 1.
3 2003/06/06 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
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