feat(android): Skia renders the text, so Arabic reads properly
An Arabic attachment name displayed scrambled. Not a missed setting: FMX's original text engine does not shape complex scripts - no bidirectional reordering, no letter joining. Separating the size from the name limited the damage without removing it. Skia carries HarfBuzz and does the work. GlobalUseSkia goes before Application.Initialize; the canvas is chosen at init and switching later does not reclaim what is already built. The price is libsk4d.so, 25 MB raw, and an APK from 13 to 22 MB. Deploy rebuilds library\\lib just before calling aapt, so a hand-placed library disappears. A proper DeployFile entry was tried first - MSBuild ignores it, as it ignores every other one in this project. Hence repack-apk.ps1, which redoes aapt, zipalign and signing on the folder already prepared. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Refait les trois dernieres etapes de l'empaquetage Android, sur le dossier
|
||||
# deja prepare - sans le vider au prealable.
|
||||
#
|
||||
# POURQUOI : la cible Deploy de MSBuild reconstruit library\lib avant d'appeler
|
||||
# aapt, ce qui efface toute bibliotheque native ajoutee a la main. Or ce projet
|
||||
# n'a pas d'entrees de deploiement fonctionnelles (voir README), donc libsk4d.so
|
||||
# - le moteur Skia, indispensable au rendu de l'arabe - ne peut y arriver
|
||||
# autrement. On laisse donc Deploy faire son travail, puis on remet la
|
||||
# bibliotheque et on refait aapt / zipalign / signature.
|
||||
#
|
||||
# A lancer depuis la racine du depot, apres un Deploy reussi.
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$sdk = 'C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository\AndroidSDK-2525-23.0.51511.6924'
|
||||
$bds = 'C:\Program Files (x86)\Embarcadero\Studio\23.0'
|
||||
$jdk = 'C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot'
|
||||
$pac = "$bds\bin\paclient.exe"
|
||||
$p = '.\Android64\Debug\pmserverApk'
|
||||
|
||||
# 1. Remettre Skia, que Deploy vient d'effacer.
|
||||
Copy-Item "$bds\binandroid64\libsk4d.so" "$p\library\lib\arm64-v8a\libsk4d.so" -Force
|
||||
|
||||
# 2. aapt : reconstruit l'archive non alignee depuis library, classes, res.
|
||||
& $pac -u8 --aaptpackage="$sdk\build-tools\33.0.2\Aapt.exe,$p\library,$p\classes,$p\res,$p\assets,$p\AndroidManifest.xml,$sdk\platforms\android-33\android.jar,$p\bin\pmserverApk-unaligned.apk"
|
||||
if ($LASTEXITCODE -ne 0) { throw "aapt a echoue" }
|
||||
|
||||
# 3. zipalign refuse d'ecraser sa sortie : l'APK precedent doit disparaitre.
|
||||
Remove-Item "$p\bin\pmserverApk.apk" -Force -ErrorAction SilentlyContinue
|
||||
& $pac -u8 --zipalign="$sdk\build-tools\33.0.2\ZipAlign.exe,$p\bin\pmserverApk-unaligned.apk,$p\bin\pmserverApk.apk,4"
|
||||
if ($LASTEXITCODE -ne 0) { throw "zipalign a echoue" }
|
||||
|
||||
& $pac -u8 --apksign="$jdk\bin\java.exe,$sdk\build-tools\33.0.2\lib\apksigner.jar,$p\bin\pmserverApk.apk,androiddebugkey,$env:APPDATA\Embarcadero\BDS\23.0\debug.keystore,android,android"
|
||||
if ($LASTEXITCODE -ne 0) { throw "signature echouee" }
|
||||
|
||||
$apk = Get-Item "$p\bin\pmserverApk.apk"
|
||||
"APK {0:N1} Mo" -f ($apk.Length / 1MB)
|
||||
Reference in New Issue
Block a user