Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9759f89b
Commit
9759f89b
authored
Apr 17, 2003
by
Emmanuel Puig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Can get size of a text
parent
beacf908
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
28 deletions
+4
-28
modules/gui/skins/gtk2/gtk2_font.cpp
modules/gui/skins/gtk2/gtk2_font.cpp
+3
-26
modules/gui/skins/gtk2/gtk2_font.h
modules/gui/skins/gtk2/gtk2_font.h
+1
-2
No files found.
modules/gui/skins/gtk2/gtk2_font.cpp
View file @
9759f89b
...
...
@@ -2,7 +2,7 @@
* gtk2_font.cpp: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_font.cpp,v 1.
6 2003/04/17 10:42:41 asmax
Exp $
* $Id: gtk2_font.cpp,v 1.
7 2003/04/17 13:46:55 karibu
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -45,12 +45,6 @@ GTK2Font::GTK2Font( intf_thread_t *_p_intf, string fontname, int size,
int
color
,
int
weight
,
bool
italic
,
bool
underline
)
:
Font
(
_p_intf
,
fontname
,
size
,
color
,
weight
,
italic
,
underline
)
{
/* FIXME */
/* GFont = gdk_font_load( "-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1" );
if( GFont == NULL )
{
msg_Err( _p_intf, "Could not load font %s", fontname.c_str());
}*/
Context
=
gdk_pango_context_get
();
Layout
=
pango_layout_new
(
Context
);
}
...
...
@@ -96,25 +90,8 @@ void GTK2Font::AssignFont( Graphics *dest )
//---------------------------------------------------------------------------
void
GTK2Font
::
GetSize
(
string
text
,
int
&
w
,
int
&
h
)
{
/* // Get device context of screen
HDC DeskDC = GetWindowDC( GetDesktopWindow() );
// Get size
LPRECT rect = new RECT;;
rect->left = 0;
rect->top = 0;
AssignGTK2Font( DeskDC );
DrawText( DeskDC, text.c_str(), text.length(), rect, DT_CALCRECT);
w = rect->right - rect->left;
h = rect->bottom - rect->top;
// Release screen device context
ReleaseDC( GetDesktopWindow(), DeskDC );*/
/*FIXME*/
/* w = gdk_text_width( GFont, text.c_str(), text.length() );
h = gdk_text_height( GFont, text.c_str(), text.length() );*/
w
=
100
;
h
=
50
;
pango_layout_set_text
(
Layout
,
text
.
c_str
(),
text
.
length
()
);
pango_layout_get_pixel_size
(
Layout
,
&
w
,
&
h
);
}
//---------------------------------------------------------------------------
void
GTK2Font
::
GenericPrint
(
Graphics
*
dest
,
string
text
,
int
x
,
int
y
,
...
...
modules/gui/skins/gtk2/gtk2_font.h
View file @
9759f89b
...
...
@@ -2,7 +2,7 @@
* gtk2_font.h: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_font.h,v 1.
3 2003/04/17 10:42:41 asmax
Exp $
* $Id: gtk2_font.h,v 1.
4 2003/04/17 13:46:55 karibu
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
...
...
@@ -45,7 +45,6 @@ class GTK2Font : Font
PangoLayout
*
Layout
;
// Assign font to Device Context
virtual
void
AssignFont
(
Graphics
*
dest
);
// void AssignGTK2Font( HDC DC );
// Helper function
virtual
void
GenericPrint
(
Graphics
*
dest
,
string
text
,
int
x
,
int
y
,
...
...
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