Commit bc00077e authored by Felix Paul Kühne's avatar Felix Paul Kühne

MVK: fix crash if font provided by the iOS app is not provided (fixes #14459)

(cherry picked from commit 5a21a985f3ab2f8771488c5d590a361cf96c900a)
parent 6b8b4f73
From 4927e1c1755d5e37fb36bc3d377f3f55a668e5b9 Mon Sep 17 00:00:00 2001
From 17ea3a20cabb373c35ef6722e3e02c9a217869ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Wed, 29 May 2013 13:25:54 +0200
Subject: [PATCH 4/9] libass: fix text rendering on iOS by providing a font
Subject: [PATCH 04/18] libass: fix text rendering on iOS by providing a font
lookup mechanism for the font shipped with Aspen
---
modules/codec/libass.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
modules/codec/libass.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 067ef6b..256ab21 100644
index 8e32d64..7f20def 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -29,6 +29,13 @@
......@@ -26,7 +26,7 @@ index 067ef6b..256ab21 100644
#include <string.h>
#include <limits.h>
#include <assert.h>
@@ -213,6 +220,34 @@ static int Create( vlc_object_t *p_this )
@@ -213,6 +220,37 @@ static int Create( vlc_object_t *p_this )
#if defined( __ANDROID__ )
const char *psz_font = "/system/fonts/DroidSans-Bold.ttf";
const char *psz_family = "Droid Sans Bold";
......@@ -39,6 +39,9 @@ index 067ef6b..256ab21 100644
+ fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("OpenSans-Regular.ttf"),
+ NULL,
+ NULL);
+ if (!fileURL)
+ return VLC_EGENERIC;
+
+ CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
+ CFRelease(fileURL);
+
......@@ -62,5 +65,5 @@ index 067ef6b..256ab21 100644
const char *psz_font = NULL; /* We don't ship a default font with VLC */
const char *psz_family = "Arial"; /* Use Arial if we can't find anything more suitable */
--
2.3.2
2.4.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment