Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
da1b496d
Commit
da1b496d
authored
Nov 22, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype/coretext: cosmetics
parent
4e4f84cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
modules/text_renderer/fonts/darwin.c
modules/text_renderer/fonts/darwin.c
+13
-6
No files found.
modules/text_renderer/fonts/darwin.c
View file @
da1b496d
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
#include "../platform_fonts.h"
#include "../platform_fonts.h"
char
*
getPathForFontDescription
(
CTFontDescriptorRef
fontDescriptor
);
char
*
getPathForFontDescription
(
CTFontDescriptorRef
fontDescriptor
);
void
addNewFont
tof
amily
(
filter_t
*
p_filter
,
CTFontDescriptorRef
iter
,
char
*
path
,
vlc_family_t
*
family
);
void
addNewFont
ToF
amily
(
filter_t
*
p_filter
,
CTFontDescriptorRef
iter
,
char
*
path
,
vlc_family_t
*
family
);
char
*
getPathForFontDescription
(
CTFontDescriptorRef
fontDescriptor
)
char
*
getPathForFontDescription
(
CTFontDescriptorRef
fontDescriptor
)
{
{
...
@@ -56,7 +56,7 @@ char* getPathForFontDescription(CTFontDescriptorRef fontDescriptor)
...
@@ -56,7 +56,7 @@ char* getPathForFontDescription(CTFontDescriptorRef fontDescriptor)
return
retPath
;
return
retPath
;
}
}
void
addNewFont
tof
amily
(
filter_t
*
p_filter
,
CTFontDescriptorRef
iter
,
char
*
path
,
vlc_family_t
*
p_family
)
void
addNewFont
ToF
amily
(
filter_t
*
p_filter
,
CTFontDescriptorRef
iter
,
char
*
path
,
vlc_family_t
*
p_family
)
{
{
bool
b_bold
=
false
;
bool
b_bold
=
false
;
bool
b_italic
=
false
;
bool
b_italic
=
false
;
...
@@ -127,7 +127,9 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
...
@@ -127,7 +127,9 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
coreTextFontDescriptors
[
x
]
=
CTFontDescriptorCreateWithAttributes
(
coreTextAttributes
[
x
]);
coreTextFontDescriptors
[
x
]
=
CTFontDescriptorCreateWithAttributes
(
coreTextAttributes
[
x
]);
}
}
CFArrayRef
coreTextFontDescriptorsArray
=
CFArrayCreate
(
kCFAllocatorDefault
,
(
const
void
**
)
&
coreTextFontDescriptors
,
numberOfAttributes
,
NULL
);
CFArrayRef
coreTextFontDescriptorsArray
=
CFArrayCreate
(
kCFAllocatorDefault
,
(
const
void
**
)
&
coreTextFontDescriptors
,
numberOfAttributes
,
NULL
);
CTFontCollectionRef
coreTextFontCollection
=
CTFontCollectionCreateWithFontDescriptors
(
coreTextFontDescriptorsArray
,
0
);
CTFontCollectionRef
coreTextFontCollection
=
CTFontCollectionCreateWithFontDescriptors
(
coreTextFontDescriptorsArray
,
0
);
...
@@ -149,7 +151,7 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
...
@@ -149,7 +151,7 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
}
}
}
}
addNewFont
tof
amily
(
p_filter
,
iter
,
path
,
p_family
);
addNewFont
ToF
amily
(
p_filter
,
iter
,
path
,
p_family
);
}
}
CFRelease
(
matchedFontDescriptions
);
CFRelease
(
matchedFontDescriptions
);
...
@@ -183,7 +185,12 @@ vlc_family_t *CoreText_GetFallbacks(filter_t *p_filter, const char *psz_family,
...
@@ -183,7 +185,12 @@ vlc_family_t *CoreText_GetFallbacks(filter_t *p_filter, const char *psz_family,
psz_family
,
psz_family
,
kCFStringEncodingUTF8
);
kCFStringEncodingUTF8
);
CTFontRef
font
=
CTFontCreateWithName
(
familyName
,
0
,
NULL
);
CTFontRef
font
=
CTFontCreateWithName
(
familyName
,
0
,
NULL
);
CFStringRef
codepointString
=
CFStringCreateWithBytes
(
kCFAllocatorDefault
,
(
const
UInt8
*
)
&
codepoint
,
sizeof
(
codepoint
),
kCFStringEncodingUTF32LE
,
false
);
uint32_t
littleEndianCodePoint
=
OSSwapHostToLittleInt32
(
codepoint
);
CFStringRef
codepointString
=
CFStringCreateWithBytes
(
kCFAllocatorDefault
,
(
const
UInt8
*
)
&
littleEndianCodePoint
,
sizeof
(
littleEndianCodePoint
),
kCFStringEncodingUTF32LE
,
false
);
CTFontRef
fallbackFont
=
CTFontCreateForString
(
font
,
codepointString
,
CFRangeMake
(
0
,
1
));
CTFontRef
fallbackFont
=
CTFontCreateForString
(
font
,
codepointString
,
CFRangeMake
(
0
,
1
));
CFStringRef
fallbackFontFamilyName
=
CTFontCopyFamilyName
(
fallbackFont
);
CFStringRef
fallbackFontFamilyName
=
CTFontCopyFamilyName
(
fallbackFont
);
...
@@ -221,7 +228,7 @@ vlc_family_t *CoreText_GetFallbacks(filter_t *p_filter, const char *psz_family,
...
@@ -221,7 +228,7 @@ vlc_family_t *CoreText_GetFallbacks(filter_t *p_filter, const char *psz_family,
goto
done
;
goto
done
;
}
}
addNewFont
tof
amily
(
p_filter
,
fallbackFontDescriptor
,
strdup
(
psz_fontPath
),
p_family
);
addNewFont
ToF
amily
(
p_filter
,
fallbackFontDescriptor
,
strdup
(
psz_fontPath
),
p_family
);
done:
done:
CFRelease
(
familyName
);
CFRelease
(
familyName
);
...
...
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