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
b15da206
Commit
b15da206
authored
Apr 17, 2003
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* beginning of font support !
parent
f2aaa523
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
modules/gui/skins/gtk2/gtk2_font.cpp
modules/gui/skins/gtk2/gtk2_font.cpp
+9
-3
modules/gui/skins/gtk2/gtk2_font.h
modules/gui/skins/gtk2/gtk2_font.h
+3
-2
No files found.
modules/gui/skins/gtk2/gtk2_font.cpp
View file @
b15da206
...
...
@@ -2,7 +2,7 @@
* gtk2_font.cpp: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_font.cpp,v 1.
5 2003/04/16 21:40:07 ipkiss
Exp $
* $Id: gtk2_font.cpp,v 1.
6 2003/04/17 10:42:41 asmax
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -51,6 +51,8 @@ GTK2Font::GTK2Font( intf_thread_t *_p_intf, string fontname, int size,
{
msg_Err( _p_intf, "Could not load font %s", fontname.c_str());
}*/
Context
=
gdk_pango_context_get
();
Layout
=
pango_layout_new
(
Context
);
}
//---------------------------------------------------------------------------
GTK2Font
::~
GTK2Font
()
...
...
@@ -111,13 +113,15 @@ void GTK2Font::GetSize( string text, int &w, int &h )
/*FIXME*/
/* w = gdk_text_width( GFont, text.c_str(), text.length() );
h = gdk_text_height( GFont, text.c_str(), text.length() );*/
w
=
0
;
h
=
0
;
w
=
10
0
;
h
=
5
0
;
}
//---------------------------------------------------------------------------
void
GTK2Font
::
GenericPrint
(
Graphics
*
dest
,
string
text
,
int
x
,
int
y
,
int
w
,
int
h
,
int
align
,
int
color
)
{
GdkDrawable
*
drawable
=
(
(
GTK2Graphics
*
)
dest
)
->
GetImage
();
GdkGC
*
gc
=
(
(
GTK2Graphics
*
)
dest
)
->
GetGC
();
/* HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle();
// Set boundaries
LPRECT r = new RECT;
...
...
@@ -143,6 +147,8 @@ void GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
// Free memory
delete r;*/
pango_layout_set_text
(
Layout
,
text
.
c_str
(),
text
.
length
()
);
gdk_draw_layout
(
drawable
,
gc
,
x
,
y
,
Layout
);
}
//---------------------------------------------------------------------------
...
...
modules/gui/skins/gtk2/gtk2_font.h
View file @
b15da206
...
...
@@ -2,7 +2,7 @@
* gtk2_font.h: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_font.h,v 1.
2 2003/04/13 17:46:22
asmax Exp $
* $Id: gtk2_font.h,v 1.
3 2003/04/17 10:42:41
asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -41,7 +41,8 @@ class Graphics;
class
GTK2Font
:
Font
{
private:
GdkFont
*
GFont
;
PangoContext
*
Context
;
PangoLayout
*
Layout
;
// Assign font to Device Context
virtual
void
AssignFont
(
Graphics
*
dest
);
// void AssignGTK2Font( HDC DC );
...
...
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