You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/09 03:04:18 UTC

[GitHub] YorkShen closed pull request #1964: [weex][android] fix the custom file ttf not work well, need replace u…

YorkShen closed pull request #1964: [weex][android] fix the custom file ttf not work well, need replace u…
URL: https://github.com/apache/incubator-weex/pull/1964
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/FontDO.java b/android/sdk/src/main/java/com/taobao/weex/utils/FontDO.java
index 076564e8c7..ae8fc0b1e7 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/FontDO.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/FontDO.java
@@ -97,7 +97,12 @@ private void parseSrc(String src, WXSDKInstance instance) {
           mType = TYPE_NETWORK;
         } else if (Constants.Scheme.FILE.equals(scheme)) {
           mType = TYPE_FILE;
-          mUrl = uri.getPath();
+            /**
+             * eg: file://name/A/B.ttf
+             * getPath() = "A/B.ttf",but the real absolute path is "/name/A/B.ttf"
+             * so use getEncodedSchemeSpecificPart() to replaced = "//name/A/B.ttf"
+             */
+            mUrl = uri.getEncodedSchemeSpecificPart();
         } else if (Constants.Scheme.LOCAL.equals(scheme)){
           mType = TYPE_LOCAL;
         } else if (Constants.Scheme.DATA.equals(scheme)) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services