Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14322

  • seanyzhou
  • seanyzhou's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
1) after use page.AddAnnotEditbox() to create freetext, all CJK chars will be blank, only English letters displayed
then we found there' a method for Annotation: page.SetEditFont(), but when we use this method, it return crash error:

UnsatisfiedLinkError: No implementation found for boolean com.radaee.pdf.Page.setAnnotEditFont()

this means that .so file doesn't implement setAnnotEditFont() yet, please check it.

2) when modify EditText, it can only show English letters, all CJK chars will be blank.

when we add setAnnotFont("Courier") to Global.java, we do see that the font of EditText chagned to Courier
this confirm that setAnnotFont() works

but when we use setAnnotFont("DroidSansChinese") instead to display chinese chars
(we confirm that the system has this font file, and already add fontfileListAdd() and setDefaultFont() for it in Global.java same as we test Courier font.
it still can't show chinese chars, all are blank on the screen

please help!

Please Log in or Create an account to join the conversation.

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14323

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
Hi, seems some devices has no DroidSansChinese.
i'm using following codes to print list of fonts:
		String face_name = null;
		int face_first = 0;
		int face_count = getFaceCount();
		while (face_first < face_count)
		{
			face_name = getFaceName(face_first);
			Log.e("Fonts", "Name:" + face_name);
			face_first++;
		}
and "DroidSansChinese" is not exists on result.
font list on my device is:
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansCJKjp-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansCJKkr-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansCJKsc-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansCJKtc-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansMonoCJKjp-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansMonoCJKkr-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansMonoCJKsc-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:1.005;GOOG;NotoSansMonoCJKtc-Regular;ADOBE
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Amiri
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Amiri-Regular
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo Bold
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo Bold Italic
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo Italic
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo-Bold
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo-BoldItalic
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Arimo-Italic
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:Ascender - Symbol Neu
2019-03-16 23:34:28.590 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine Bold
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine Bold Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine-Bold
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine-BoldItalic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Cousine-Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Google:Roboto Regular:2017
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Hanyi HYQiHei-50S Light v5.00
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:HYQiHei-50S Light
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:HYQiHei-EZS
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Arimo
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Arimo Bold
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Arimo Bold Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Arimo Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Cousine
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Cousine Bold
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Cousine Bold Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Cousine Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Tinos
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Tinos Bold
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Tinos Bold Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Monotype Imaging - Tinos Italic
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans CJK JP Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans CJK KR Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans CJK SC Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans CJK TC Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans Mono CJK JP Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans Mono CJK KR Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans Mono CJK SC Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Noto Sans Mono CJK TC Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansCJKjp-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansCJKkr-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansCJKsc-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansCJKtc-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansMonoCJKjp-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansMonoCJKkr-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansMonoCJKsc-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:NotoSansMonoCJKtc-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Roboto
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Roboto-Regular
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Sorts Mill Tools 2.1.0_alpha1 : Amiri : 29-12-2013
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:Symbol Neu for Powerline
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:SymbolNeuForPowerline
2019-03-16 23:34:28.591 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos Bold
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos Bold Italic
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos Italic
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos-Bold
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos-BoldItalic
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:Tinos-Italic
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:null
2019-03-16 23:34:28.592 2753-2753/com.radaee.reader E/Fonts: Name:汉仪旗黑-50S Light
when i pass "Noto Sans CJK SC Regular" setAnnotFont(). textbox display Chinese chars.

the best way to support CJK charset shall be :
package a CJK font on you APP, and extract font in Global.init().

setAnnotEditFont seems exists on JNI library, i will better check later.

Please Log in or Create an account to join the conversation.

Last edit: by radaee.

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14324

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
we checked on Annotation.setEditFont(), wrong function name on JNI codes.
we will update next week for this function.

Please Log in or Create an account to join the conversation.

Last edit: by radaee.

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14325

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Dear user,
the new demo version is now available.
This version contains the fix of Annotation.setEditFont() method.
You could download it from here: www.radaeepdf.com/download/download-prev...120-radaeepdf-3-50-2

Please Log in or Create an account to join the conversation.

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14326

  • seanyzhou
  • seanyzhou's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
continued problem:

after add setAnnotFont("Noto Sans CJK SC Regular"), it does show chines chars, but there's a big problem:
each time I input text to edit-box, the pdf filesize will add 13MB+. after I test to input text to 3 edit-box, the file size increase from 100K to 41MB, that's very horrible.

is there any option that I can input text only but it DOESN'T save the font resource to the pdf file? at least doesn't save the font duplicated each time, you can imagine, if I fill a pdf with 100 edit-box, it'll be 100*13MB size @_@

the setAnnotFont() should allow to display the edit-text only, but doesn't save font resource each time I edit it.

Please Log in or Create an account to join the conversation.

two bug? SetEditFont() failed, setAnnotFont() not work for CJK 5 years 1 month ago #14327

  • seanyzhou
  • seanyzhou's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Tested 3.50.2beta3, I confirm that the free text setEditFont() bug has been fixed, and after added free text with any chars, any NewFontCid , the pdf file size is still almost the same.
Thanks for the work!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum