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:
+15
-2
@@ -3,6 +3,16 @@ program pmserverApk;
|
||||
uses
|
||||
System.StartUpCopy,
|
||||
FMX.Forms,
|
||||
// Skia remplace le moteur de rendu de FMX. Ce n'est pas un choix esthetique :
|
||||
// celui d'origine ne met pas en forme les ecritures complexes - pas de
|
||||
// reordonnancement bidirectionnel, pas de liaison des lettres arabes - et un
|
||||
// nom de piece jointe en arabe s'affichait donc en desordre. Skia embarque
|
||||
// HarfBuzz et fait ce travail correctement.
|
||||
//
|
||||
// Le prix est libsk4d.so, 25 Mo, a poser dans lib/arm64-v8a de l'APK. Le
|
||||
// deploiement automatique s'en chargerait ; ici il ne deploie rien, donc la
|
||||
// bibliotheque est mise en place a la main comme le manifeste et les .dex.
|
||||
FMX.Skia,
|
||||
mainApk in 'mainApk.pas' {Form8},
|
||||
PMA.Crypto in 'android-client\PMA.Crypto.pas',
|
||||
PMA.TestVector in 'android-client\PMA.TestVector.pas',
|
||||
@@ -18,9 +28,12 @@ uses
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
// AVANT Application.Initialize : le canevas est choisi a l'initialisation,
|
||||
// et le basculer ensuite ne rattrape pas ce qui est deja construit.
|
||||
GlobalUseSkia := True;
|
||||
Application.Initialize;
|
||||
// Avant la creation de la forme : appliquer un style apres coup laisse les
|
||||
// controles deja construits avec l'ancien.
|
||||
// Le style se pose apres l'initialisation mais avant la forme : l'appliquer
|
||||
// plus tard laisserait les controles deja construits avec l'ancien.
|
||||
ApplyDarkTheme;
|
||||
Application.CreateForm(TForm8, Form8);
|
||||
Application.Run;
|
||||
|
||||
Reference in New Issue
Block a user