summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk
diff options
context:
space:
mode:
authorJordan Kiley <jmkiley@users.noreply.github.com>2019-01-07 16:19:29 -0800
committerGitHub <noreply@github.com>2019-01-07 16:19:29 -0800
commite3d622ec35462d5a25c44dd30afee73ba5ded7e9 (patch)
treea832f3b5bc3536c8b4b39fc84a39c4231e8c3405 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk
parent80647fe10ec0c416dd07d7fd607d0fae26679c57 (diff)
downloadqtlocation-mapboxgl-e3d622ec35462d5a25c44dd30afee73ba5ded7e9.tar.gz
[ios] Cherry-pick #13427 - Expose "local ideograph font family" in map snapshotters (#13547)
* [ios] Cherry-pick #13427 * [node] - used fix version of cmake node module
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
index fac6a75742..bd697fb1c8 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
@@ -93,6 +93,7 @@ public class MapSnapshotter {
private LatLngBounds region;
private CameraPosition cameraPosition;
private boolean showLogo = true;
+ private String localIdeographFontFamily;
/**
* @param width the width of the image
@@ -164,6 +165,22 @@ public class MapSnapshotter {
}
/**
+ * Set the font family for generating glyphs locally for ideographs in the &#x27;CJK Unified Ideographs&#x27;
+ * and &#x27;Hangul Syllables&#x27; ranges.
+ * <p>
+ * The font family argument is passed to {@link android.graphics.Typeface#create(String, int)}.
+ * Default system fonts are defined in &#x27;/system/etc/fonts.xml&#x27;
+ *
+ * @param fontFamily font family for local ideograph generation.
+ * @return the mutated {@link Options}
+ */
+ @NonNull
+ public Options withLocalIdeographFontFamily(String fontFamily) {
+ this.localIdeographFontFamily = fontFamily;
+ return this;
+ }
+
+ /**
* @return the width of the image
*/
public int getWidth() {
@@ -206,6 +223,14 @@ public class MapSnapshotter {
public CameraPosition getCameraPosition() {
return cameraPosition;
}
+
+ /**
+ * @return the font family used for locally generating ideographs
+ */
+ public String getLocalIdeographFontFamily() {
+ return localIdeographFontFamily;
+ }
+
}
/**
@@ -223,7 +248,7 @@ public class MapSnapshotter {
nativeInitialize(this, fileSource, options.pixelRatio, options.width,
options.height, options.styleUrl, options.styleJson, options.region, options.cameraPosition,
- options.showLogo, programCacheDir);
+ options.showLogo, programCacheDir, options.localIdeographFontFamily);
}
/**
@@ -498,7 +523,8 @@ public class MapSnapshotter {
FileSource fileSource, float pixelRatio,
int width, int height, String styleUrl, String styleJson,
LatLngBounds region, CameraPosition position,
- boolean showLogo, String programCacheDir);
+ boolean showLogo, String programCacheDir,
+ String localIdeographFontFamily);
@Keep
protected native void nativeStart();