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
e014ef73
Commit
e014ef73
authored
Mar 01, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: fix font path processing
parent
2d32bb48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
28 deletions
+23
-28
modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/builder.cpp
+23
-28
No files found.
modules/gui/skins2/parser/builder.cpp
View file @
e014ef73
...
...
@@ -277,41 +277,36 @@ void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
void
Builder
::
addFont
(
const
BuilderData
::
Font
&
rData
)
{
string
full_path
=
getFilePath
(
rData
.
m_fontFile
);
if
(
!
full_path
.
size
()
)
return
;
// Try to load the font from the theme directory
GenericFont
*
pFont
=
new
FT2Font
(
getIntf
(),
full_path
,
rData
.
m_size
);
if
(
pFont
->
init
()
)
{
m_pTheme
->
m_fonts
[
rData
.
m_id
]
=
GenericFontPtr
(
pFont
);
}
else
string
full_path
=
getFilePath
(
rData
.
m_fontFile
);
if
(
full_path
.
size
()
)
{
GenericFont
*
pFont
=
new
FT2Font
(
getIntf
(),
full_path
,
rData
.
m_size
);
if
(
pFont
->
init
()
)
{
m_pTheme
->
m_fonts
[
rData
.
m_id
]
=
GenericFontPtr
(
pFont
);
return
;
}
delete
pFont
;
}
// Font not found; try in the resource path
OSFactory
*
pOSFactory
=
OSFactory
::
instance
(
getIntf
()
);
const
list
<
string
>
&
resPath
=
pOSFactory
->
getResourcePath
();
const
string
&
sep
=
pOSFactory
->
getDirSeparator
();
// Font not found; try in the resource path
OSFactory
*
pOSFactory
=
OSFactory
::
instance
(
getIntf
()
);
const
list
<
string
>
&
resPath
=
pOSFactory
->
getResourcePath
();
const
string
&
sep
=
pOSFactory
->
getDirSeparator
();
list
<
string
>::
const_iterator
it
;
for
(
it
=
resPath
.
begin
();
it
!=
resPath
.
end
();
it
++
)
list
<
string
>::
const_iterator
it
;
for
(
it
=
resPath
.
begin
();
it
!=
resPath
.
end
();
++
it
)
{
string
path
=
(
*
it
)
+
sep
+
"fonts"
+
sep
+
rData
.
m_fontFile
;
GenericFont
*
pFont
=
new
FT2Font
(
getIntf
(),
path
,
rData
.
m_size
);
if
(
pFont
->
init
()
)
{
string
path
=
(
*
it
)
+
sep
+
"fonts"
+
sep
+
rData
.
m_fontFile
;
pFont
=
new
FT2Font
(
getIntf
(),
path
,
rData
.
m_size
);
if
(
pFont
->
init
()
)
{
// Font loaded successfully
m_pTheme
->
m_fonts
[
rData
.
m_id
]
=
GenericFontPtr
(
pFont
);
break
;
}
else
{
delete
pFont
;
}
// Font loaded successfully
m_pTheme
->
m_fonts
[
rData
.
m_id
]
=
GenericFontPtr
(
pFont
);
return
;
}
delete
pFont
;
}
}
...
...
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