diff --git a/.gitignore b/.gitignore index bdb9604..0d179d1 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,7 @@ DerivedData/ # The web app build copied for Caddy (docs/WEB.md); never committed. deploy/web/ + +# Store capture raws: regenerated by tools/store/capture.py +docs/store/screenshots/raw/ +docs/store/screenshots/raw-tablets/ diff --git a/docs/store/play-listing/de-DE/full_description.txt b/docs/store/play-listing/de-DE/full_description.txt new file mode 100644 index 0000000..0d79024 --- /dev/null +++ b/docs/store/play-listing/de-DE/full_description.txt @@ -0,0 +1,45 @@ +Lerne Englisch, indem du es sprichst, und wisse genau, wie du klingst. Glosso ist ein Englischkurs rund um deine eigene Stimme: In jeder Lektion liest du, hörst zu, antwortest und sprichst, und deine Aussprache wird Laut für Laut gemessen. Keine Werbung. Kein Konto nötig. + +WARUM GLOSSO +- Ein vollständiger Kurs von A1 bis B2: über 220 Lektionen mit Dialogen, Geschichten und Artikeln +- Amerikanisches oder britisches Englisch: Du wählst den Akzent, der ganze Kurs folgt +- Du bist dran: Hör einen Satz und antworte aus dem Kopf, auf Englisch +- Wiederholung zur richtigen Zeit: Gesagte Sätze kommen Tage später zurück +- Neu: ein Russischkurs A1 aus der russischen Kultur heraus, mit Kulturnotizen in jeder Lektion +- Neu: ein Spanischkurs A1 aus Spanien, in einer ersten experimentellen Version +- Aussprache bewertet Wort für Wort und Laut für Laut (IPA) +- Bewertung auf dem Gerät: Modell herunterladen und offline üben +- Privat von Grund auf: keine Werbung und keine Tracker von Dritten + +* LEKTIONEN, DIE DICH ZUM SPRECHEN BRINGEN +Jede Lektion beginnt mit einem Dialog, einer Geschichte oder einem Artikel zum Lesen und Hören, Zeile für Zeile. Danach folgen Übungen, ein Schritt, in dem du aus dem Kopf antwortest, und Ausspracheübungen zu den Lauten dieser Lektion. + +* AMERIKANISCHES ODER BRITISCHES ENGLISCH +Wähle den Akzent, den du lernen willst. Texte, Schreibweise, Lautschrift und Referenzstimmen wechseln gemeinsam: „Mom“ und „favorite“ im amerikanischen Englisch, „Mum“ und „favourite“ im britischen Englisch. + +* DU BIST DRAN +Glosso gibt dir die Idee in deiner Sprache und du sagst den Satz auf Englisch, ohne ihn zu lesen. Der Satz erscheint, sobald du ihn gesagt hast. Näher kommst du allein nicht an ein echtes Gespräch heran. + +* GEMESSENE AUSSPRACHE +Sprich und erhalte eine Bewertung für jedes Wort und jeden Laut. Sieh genau, welcher Laut danebenging, hör die Referenz noch einmal und versuch es erneut. Lässt sich eine Aufnahme nicht beurteilen, sagt dir die App das, statt dir eine schlechte Note zu geben. + +* WIEDERHOLUNG ZUR RICHTIGEN ZEIT +Die Sätze, die du gesagt hast, kommen in späteren Lektionen zurück: nach einem Tag, nach einigen Tagen, dann nach Wochen. So bleiben sie. + +* PRIVAT UND OFFLINE +Glosso kann deine Stimme auf deinem Gerät bewerten. Lade das Modell einmal herunter und übe ohne Verbindung: im Flugzeug, in der U-Bahn, zu Hause. In der aktuellen Beta kann die Bewertung stattdessen über unseren Server laufen, und die App sagt es dir. Dein Audio wird nur zur Bewertung deines Versuchs genutzt: nie verkauft, nie für Werbung verwendet. + +* DEIN FORTSCHRITT +Sieh, welche Laute du beherrschst und welche Arbeit brauchen, mit deinem eigenen Trend über die Zeit, täglichen Serien und Erfolgen. + +* SPRACHEN +Der Englischkurs (amerikanisch und britisch, Niveaus A1 bis B2) ist heute verfügbar, und der Russischkurs ist neu auf Niveau A1, aus der russischen Kultur heraus geschrieben, A2 bis B2 folgen später; die Bewertung auf Russisch braucht eine Verbindung. Neu ist auch ein Spanischkurs A1 aus Spanien, in einer experimentellen Version. Die Oberfläche ist auf Englisch, Spanisch, Französisch, Deutsch, Russisch, Hindi und Arabisch übersetzt. Weitere Kurse sind geplant; Französisch und Deutsch kommen als Nächstes. + +IDEAL FÜR +- Lernende, die beim Englischsprechen verstanden werden wollen +- Alle, die den mündlichen Teil einer Prüfung vorbereiten (IELTS, TOEFL, PTE und andere) +- Berufstätige und Menschen, die vor Publikum sprechen +- Zugewanderte und Expats, die sich in einem neuen Land einleben +- Lehrkräfte und Tutoren für Aussprache oder Akzenttraining + +Glosso ist in der offenen Beta und kostenlos, solange es wächst. Lade es herunter und sprich mit mehr Selbstvertrauen: ehrliches, privates Feedback auf deinem Handy. \ No newline at end of file diff --git a/docs/store/play-listing/de-DE/short_description.txt b/docs/store/play-listing/de-DE/short_description.txt new file mode 100644 index 0000000..1429af1 --- /dev/null +++ b/docs/store/play-listing/de-DE/short_description.txt @@ -0,0 +1 @@ +Englischkurs, der deine Aussprache misst. Amerikanisch oder britisch, A1-B2. \ No newline at end of file diff --git a/docs/store/play-listing/de-DE/title.txt b/docs/store/play-listing/de-DE/title.txt new file mode 100644 index 0000000..e729032 --- /dev/null +++ b/docs/store/play-listing/de-DE/title.txt @@ -0,0 +1 @@ +Glosso: Englische Aussprache \ No newline at end of file diff --git a/docs/store/play-listing/en-US/full_description.txt b/docs/store/play-listing/en-US/full_description.txt new file mode 100644 index 0000000..6dac77a --- /dev/null +++ b/docs/store/play-listing/en-US/full_description.txt @@ -0,0 +1,45 @@ +Learn English by speaking it, and know exactly how you sound. Glosso is an English course built around your own voice: in every lesson you read, listen, answer and speak, and your pronunciation is measured sound by sound. No ads. No account required. + +WHY GLOSSO +- A full course from A1 to B2: over 220 lessons with dialogues, stories and articles +- American or British English: pick your accent and the whole course follows +- Your turn: hear a line and answer from memory, in English +- Drills on the sounds of each lesson, at normal and slow speed +- New: a Russian A1 course built from Russian culture, with culture notes in every lesson +- New: a Spanish A1 course from Spain, in an early experimental version +- Pronunciation scored word by word and sound by sound (IPA) +- On-device scoring: download the model and practice offline +- Private by design: no ads and no third-party trackers + +* LESSONS THAT MAKE YOU SPEAK +Each lesson starts with a dialogue, a story or an article you can read and hear line by line. Then come exercises, a step where you answer from memory, and pronunciation drills on the sounds of that lesson. + +* AMERICAN OR BRITISH ENGLISH +Choose the accent you want to learn. The texts, the spelling, the phonetic transcription and the reference voices switch together: "Mom" and "favorite" in American English, "Mum" and "favourite" in British English. + +* YOUR TURN +You hear the other person's line and say yours without reading it. The sentence appears once you have said it. It is the closest thing to a real conversation you can practice on your own. + +* DRILLS FOR EVERY SOUND +Each drill pairs the sound with the one it gets confused with ("think" and "sink"). Hear the reference at normal or slow speed, say the sentence and listen to your own take. + +* MEASURED PRONUNCIATION +Speak and get a score for every word and every sound. See exactly which sound slipped, hear the reference again and try once more. When a recording cannot be judged, the app says so instead of giving you a low score. + +* PRIVATE AND OFFLINE +Glosso can score your voice on your device. Download the model once and practice without a connection: on a plane, on the subway, at home. In the current beta, scoring may use our server instead, and the app tells you when. Your audio is used only to score your attempt: never sold, never used for ads. + +* YOUR PROGRESS +See which sounds you have mastered and which need work, with your own trend over time, daily streaks and achievements. + +* LANGUAGES +The English course (American and British, levels A1 to B2) is available today, and a Russian course is new at level A1, written from Russian culture, with A2 to B2 coming later; scoring Russian needs a connection. A Spanish A1 course from Spain is new too, in an experimental version. The app interface is translated into English, Spanish, French, German, Russian, Hindi and Arabic. More courses are planned; French and German come next. + +PERFECT FOR +- Learners who want their spoken English to be understood +- People preparing the speaking part of an exam (IELTS, TOEFL, PTE and others) +- Business professionals and public speakers +- Immigrants and expats adapting to a new country +- Teachers and tutors of pronunciation or accent training + +Glosso is in open beta and free while it grows. Download it and start speaking with more confidence: honest, private feedback, on your phone. \ No newline at end of file diff --git a/docs/store/play-listing/en-US/short_description.txt b/docs/store/play-listing/en-US/short_description.txt new file mode 100644 index 0000000..02296b8 --- /dev/null +++ b/docs/store/play-listing/en-US/short_description.txt @@ -0,0 +1 @@ +English course that measures how you sound. American or British, A1 to B2. \ No newline at end of file diff --git a/docs/store/play-listing/en-US/title.txt b/docs/store/play-listing/en-US/title.txt new file mode 100644 index 0000000..28b4eb6 --- /dev/null +++ b/docs/store/play-listing/en-US/title.txt @@ -0,0 +1 @@ +Glosso: English Pronunciation \ No newline at end of file diff --git a/docs/store/play-listing/es-ES/full_description.txt b/docs/store/play-listing/es-ES/full_description.txt new file mode 100644 index 0000000..ddaf41d --- /dev/null +++ b/docs/store/play-listing/es-ES/full_description.txt @@ -0,0 +1,45 @@ +Aprende inglés hablándolo y sabiendo exactamente cómo suenas. Glosso es un curso de inglés construido alrededor de tu propia voz: en cada lección lees, escuchas, respondes y hablas, y tu pronunciación se mide sonido a sonido. Sin anuncios. Sin cuenta obligatoria. + +POR QUÉ GLOSSO +- Un curso completo de A1 a B2: más de 220 lecciones con diálogos, historias y artículos +- Inglés americano o británico: eliges acento y todo el curso lo sigue +- Tu turno: escuchas una frase y respondes de memoria, en inglés +- Pronunciación puntuada palabra por palabra y sonido a sonido (IPA) +- Repaso en el momento justo: las frases que dijiste vuelven días después +- Puntuación en el dispositivo: descarga el modelo y practica sin conexión +- Nuevo: un curso de ruso A1 hecho desde la cultura rusa, con notas de cultura en cada lección +- Nuevo: un curso de español A1 de España, en una primera versión experimental +- Privado por diseño: sin anuncios ni rastreadores de terceros + +* LECCIONES QUE TE HACEN HABLAR +Cada lección empieza con un diálogo, una historia o un artículo que puedes leer y escuchar línea a línea. Después vienen ejercicios, un paso en el que respondes de memoria y ejercicios de pronunciación con los sonidos de esa lección. + +* INGLÉS AMERICANO O BRITÁNICO +Elige el acento que quieres aprender. Los textos, la ortografía, la transcripción fonética y las voces de referencia cambian a la vez: "Mom" y "favorite" en inglés americano, "Mum" y "favourite" en inglés británico. + +* TU TURNO +Glosso te da la idea en tu idioma y tú dices la frase en inglés, sin leerla. La frase aparece cuando ya la has dicho. Es lo más parecido a una conversación real que puedes practicar a solas. + +* PRONUNCIACIÓN MEDIDA +Habla y recibe una nota por cada palabra y cada sonido. Ves exactamente qué sonido se te escapó, vuelves a escuchar la referencia y lo intentas otra vez. Si una grabación no se puede evaluar, la app te lo dice en vez de ponerte una nota baja. + +* REPASO EN EL MOMENTO JUSTO +Las frases que dijiste vuelven en lecciones posteriores: al día siguiente, a los pocos días y a las semanas. Así se quedan. + +* PRIVADO Y SIN CONEXIÓN +Glosso puede puntuar tu voz en tu dispositivo. Descarga el modelo una vez y practica sin conexión: en un avión, en el metro, en casa. En la beta actual la puntuación puede usar nuestro servidor, y la app te avisa. Tu audio solo se usa para puntuar tu intento: nunca se vende ni se usa para anuncios. + +* TU PROGRESO +Ves qué sonidos dominas y cuáles necesitan trabajo, con tu propia tendencia en el tiempo, rachas diarias y logros. + +* IDIOMAS +El curso de inglés (americano y británico, niveles A1 a B2) está disponible hoy, y el curso de ruso es nuevo en el nivel A1, escrito desde la cultura rusa, y A2 a B2 llegarán más adelante; para puntuar en ruso hace falta conexión. También es nuevo un curso de español A1 de España, en versión experimental. La interfaz está traducida a inglés, español, francés, alemán, ruso, hindi y árabe. Habrá más cursos: francés y alemán son los siguientes. + +IDEAL PARA +- Quien quiere que se le entienda al hablar inglés +- Quien prepara la parte oral de un examen (IELTS, TOEFL, PTE y otros) +- Profesionales y personas que hablan en público +- Inmigrantes y expatriados que se adaptan a un país nuevo +- Profesores y tutores de pronunciación o acento + +Glosso está en beta abierta y es gratis mientras crece. Descárgalo y empieza a hablar con más confianza: feedback honesto y privado, en tu móvil. \ No newline at end of file diff --git a/docs/store/play-listing/es-ES/short_description.txt b/docs/store/play-listing/es-ES/short_description.txt new file mode 100644 index 0000000..da928bc --- /dev/null +++ b/docs/store/play-listing/es-ES/short_description.txt @@ -0,0 +1 @@ +Curso de inglés que mide cómo suenas. Americano o británico, de A1 a B2. \ No newline at end of file diff --git a/docs/store/play-listing/es-ES/title.txt b/docs/store/play-listing/es-ES/title.txt new file mode 100644 index 0000000..5d29988 --- /dev/null +++ b/docs/store/play-listing/es-ES/title.txt @@ -0,0 +1 @@ +Glosso: Pronunciación inglés \ No newline at end of file diff --git a/docs/store/play-listing/fr-FR/full_description.txt b/docs/store/play-listing/fr-FR/full_description.txt new file mode 100644 index 0000000..a1c6819 --- /dev/null +++ b/docs/store/play-listing/fr-FR/full_description.txt @@ -0,0 +1,45 @@ +Apprenez l'anglais en le parlant, en sachant exactement comment vous sonnez. Glosso est un cours d'anglais construit autour de votre propre voix : à chaque leçon vous lisez, écoutez, répondez et parlez, et votre prononciation est mesurée son par son. Sans publicité. Sans compte obligatoire. + +POURQUOI GLOSSO +- Un cours complet de A1 à B2 : plus de 220 leçons avec dialogues, histoires et articles +- Anglais américain ou britannique : choisissez votre accent, tout le cours suit +- À vous : écoutez une réplique et répondez de mémoire, en anglais +- Révision au bon moment : les phrases que vous avez dites reviennent quelques jours plus tard +- Nouveau : un cours de russe A1 construit à partir de la culture russe, avec des notes culturelles dans chaque leçon +- Nouveau : un cours d'espagnol A1 d'Espagne, dans une première version expérimentale +- Prononciation notée mot par mot et son par son (API) +- Notation sur l'appareil : téléchargez le modèle et pratiquez hors ligne +- Privé par conception : sans publicité ni traceurs tiers + +* DES LEÇONS QUI FONT PARLER +Chaque leçon commence par un dialogue, une histoire ou un article à lire et à écouter ligne par ligne. Viennent ensuite des exercices, une étape où vous répondez de mémoire, puis des exercices de prononciation sur les sons de la leçon. + +* ANGLAIS AMÉRICAIN OU BRITANNIQUE +Choisissez l'accent que vous voulez apprendre. Les textes, l'orthographe, la transcription phonétique et les voix de référence changent ensemble : « Mom » et « favorite » en anglais américain, « Mum » et « favourite » en anglais britannique. + +* À VOUS +Glosso vous donne l'idée dans votre langue et vous dites la phrase en anglais, sans la lire. La phrase apparaît une fois que vous l'avez dite. C'est ce qui se rapproche le plus d'une vraie conversation quand on s'entraîne seul. + +* UNE PRONONCIATION MESURÉE +Parlez et recevez une note pour chaque mot et chaque son. Voyez exactement quel son vous a échappé, réécoutez la référence et réessayez. Si un enregistrement ne peut pas être évalué, l'application vous le dit au lieu de vous donner une mauvaise note. + +* RÉVISION AU BON MOMENT +Les phrases que vous avez dites reviennent dans les leçons suivantes : le lendemain, quelques jours après, puis quelques semaines après. C'est ainsi qu'elles restent. + +* PRIVÉ ET HORS LIGNE +Glosso peut noter votre voix sur votre appareil. Téléchargez le modèle une fois et pratiquez sans connexion : en avion, dans le métro, à la maison. Dans la bêta actuelle, la notation peut passer par notre serveur, et l'application vous en informe. Votre audio sert uniquement à noter votre tentative : jamais vendu, jamais utilisé pour la publicité. + +* VOTRE PROGRESSION +Voyez quels sons vous maîtrisez et lesquels demandent du travail, avec votre propre tendance dans le temps, des séries quotidiennes et des succès. + +* LANGUES +Le cours d'anglais (américain et britannique, niveaux A1 à B2) est disponible aujourd'hui, et le cours de russe est nouveau au niveau A1, écrit à partir de la culture russe, A2 à B2 arriveront plus tard ; la notation en russe demande une connexion. Un cours d'espagnol A1 d'Espagne est aussi nouveau, en version expérimentale. L'interface est traduite en anglais, espagnol, français, allemand, russe, hindi et arabe. D'autres cours sont prévus ; le français et l'allemand arrivent ensuite. + +IDÉAL POUR +- Ceux qui veulent être compris quand ils parlent anglais +- Ceux qui préparent l'oral d'un examen (IELTS, TOEFL, PTE et autres) +- Les professionnels et les orateurs +- Les immigrés et expatriés qui s'adaptent à un nouveau pays +- Les enseignants et tuteurs de prononciation ou d'accent + +Glosso est en bêta ouverte et gratuit pendant sa croissance. Téléchargez-le et parlez avec plus d'assurance : un retour honnête et privé, sur votre téléphone. \ No newline at end of file diff --git a/docs/store/play-listing/fr-FR/short_description.txt b/docs/store/play-listing/fr-FR/short_description.txt new file mode 100644 index 0000000..eb6f3af --- /dev/null +++ b/docs/store/play-listing/fr-FR/short_description.txt @@ -0,0 +1 @@ +Cours d'anglais qui mesure votre prononciation. Américain ou britannique. \ No newline at end of file diff --git a/docs/store/play-listing/fr-FR/title.txt b/docs/store/play-listing/fr-FR/title.txt new file mode 100644 index 0000000..093ce5a --- /dev/null +++ b/docs/store/play-listing/fr-FR/title.txt @@ -0,0 +1 @@ +Glosso: prononciation anglais \ No newline at end of file diff --git a/docs/store/screenshots/framed/de/01_today.png b/docs/store/screenshots/framed/de/01_today.png new file mode 100644 index 0000000..0b754f3 Binary files /dev/null and b/docs/store/screenshots/framed/de/01_today.png differ diff --git a/docs/store/screenshots/framed/de/02_feedback.png b/docs/store/screenshots/framed/de/02_feedback.png new file mode 100644 index 0000000..29a4c15 Binary files /dev/null and b/docs/store/screenshots/framed/de/02_feedback.png differ diff --git a/docs/store/screenshots/framed/de/03_switcher.png b/docs/store/screenshots/framed/de/03_switcher.png new file mode 100644 index 0000000..7ed8792 Binary files /dev/null and b/docs/store/screenshots/framed/de/03_switcher.png differ diff --git a/docs/store/screenshots/framed/de/04_es_dialogue.png b/docs/store/screenshots/framed/de/04_es_dialogue.png new file mode 100644 index 0000000..ff2c00c Binary files /dev/null and b/docs/store/screenshots/framed/de/04_es_dialogue.png differ diff --git a/docs/store/screenshots/framed/de/05_ru_dialogue.png b/docs/store/screenshots/framed/de/05_ru_dialogue.png new file mode 100644 index 0000000..b673e7a Binary files /dev/null and b/docs/store/screenshots/framed/de/05_ru_dialogue.png differ diff --git a/docs/store/screenshots/framed/de/06_ru_context.png b/docs/store/screenshots/framed/de/06_ru_context.png new file mode 100644 index 0000000..7c7adc5 Binary files /dev/null and b/docs/store/screenshots/framed/de/06_ru_context.png differ diff --git a/docs/store/screenshots/framed/de/07_you.png b/docs/store/screenshots/framed/de/07_you.png new file mode 100644 index 0000000..140154e Binary files /dev/null and b/docs/store/screenshots/framed/de/07_you.png differ diff --git a/docs/store/screenshots/framed/de/08_lessons.png b/docs/store/screenshots/framed/de/08_lessons.png new file mode 100644 index 0000000..961ba10 Binary files /dev/null and b/docs/store/screenshots/framed/de/08_lessons.png differ diff --git a/docs/store/screenshots/framed/en/01_today.png b/docs/store/screenshots/framed/en/01_today.png new file mode 100644 index 0000000..0729fd1 Binary files /dev/null and b/docs/store/screenshots/framed/en/01_today.png differ diff --git a/docs/store/screenshots/framed/en/02_feedback.png b/docs/store/screenshots/framed/en/02_feedback.png new file mode 100644 index 0000000..35d4dd4 Binary files /dev/null and b/docs/store/screenshots/framed/en/02_feedback.png differ diff --git a/docs/store/screenshots/framed/en/03_switcher.png b/docs/store/screenshots/framed/en/03_switcher.png new file mode 100644 index 0000000..f3a7236 Binary files /dev/null and b/docs/store/screenshots/framed/en/03_switcher.png differ diff --git a/docs/store/screenshots/framed/en/04_es_dialogue.png b/docs/store/screenshots/framed/en/04_es_dialogue.png new file mode 100644 index 0000000..2e8d3e7 Binary files /dev/null and b/docs/store/screenshots/framed/en/04_es_dialogue.png differ diff --git a/docs/store/screenshots/framed/en/05_ru_dialogue.png b/docs/store/screenshots/framed/en/05_ru_dialogue.png new file mode 100644 index 0000000..763e556 Binary files /dev/null and b/docs/store/screenshots/framed/en/05_ru_dialogue.png differ diff --git a/docs/store/screenshots/framed/en/06_ru_context.png b/docs/store/screenshots/framed/en/06_ru_context.png new file mode 100644 index 0000000..10641e6 Binary files /dev/null and b/docs/store/screenshots/framed/en/06_ru_context.png differ diff --git a/docs/store/screenshots/framed/en/07_you.png b/docs/store/screenshots/framed/en/07_you.png new file mode 100644 index 0000000..a4d8ea8 Binary files /dev/null and b/docs/store/screenshots/framed/en/07_you.png differ diff --git a/docs/store/screenshots/framed/en/08_lessons.png b/docs/store/screenshots/framed/en/08_lessons.png new file mode 100644 index 0000000..bf1ec56 Binary files /dev/null and b/docs/store/screenshots/framed/en/08_lessons.png differ diff --git a/docs/store/screenshots/framed/es/01_today.png b/docs/store/screenshots/framed/es/01_today.png new file mode 100644 index 0000000..82861e4 Binary files /dev/null and b/docs/store/screenshots/framed/es/01_today.png differ diff --git a/docs/store/screenshots/framed/es/02_feedback.png b/docs/store/screenshots/framed/es/02_feedback.png new file mode 100644 index 0000000..153be26 Binary files /dev/null and b/docs/store/screenshots/framed/es/02_feedback.png differ diff --git a/docs/store/screenshots/framed/es/03_switcher.png b/docs/store/screenshots/framed/es/03_switcher.png new file mode 100644 index 0000000..6476047 Binary files /dev/null and b/docs/store/screenshots/framed/es/03_switcher.png differ diff --git a/docs/store/screenshots/framed/es/04_es_dialogue.png b/docs/store/screenshots/framed/es/04_es_dialogue.png new file mode 100644 index 0000000..e9ff052 Binary files /dev/null and b/docs/store/screenshots/framed/es/04_es_dialogue.png differ diff --git a/docs/store/screenshots/framed/es/05_ru_dialogue.png b/docs/store/screenshots/framed/es/05_ru_dialogue.png new file mode 100644 index 0000000..daa98b1 Binary files /dev/null and b/docs/store/screenshots/framed/es/05_ru_dialogue.png differ diff --git a/docs/store/screenshots/framed/es/06_ru_context.png b/docs/store/screenshots/framed/es/06_ru_context.png new file mode 100644 index 0000000..89854e7 Binary files /dev/null and b/docs/store/screenshots/framed/es/06_ru_context.png differ diff --git a/docs/store/screenshots/framed/es/07_you.png b/docs/store/screenshots/framed/es/07_you.png new file mode 100644 index 0000000..525be0a Binary files /dev/null and b/docs/store/screenshots/framed/es/07_you.png differ diff --git a/docs/store/screenshots/framed/es/08_lessons.png b/docs/store/screenshots/framed/es/08_lessons.png new file mode 100644 index 0000000..809f765 Binary files /dev/null and b/docs/store/screenshots/framed/es/08_lessons.png differ diff --git a/docs/store/screenshots/framed/fr/01_today.png b/docs/store/screenshots/framed/fr/01_today.png new file mode 100644 index 0000000..01fc7a6 Binary files /dev/null and b/docs/store/screenshots/framed/fr/01_today.png differ diff --git a/docs/store/screenshots/framed/fr/02_feedback.png b/docs/store/screenshots/framed/fr/02_feedback.png new file mode 100644 index 0000000..c847037 Binary files /dev/null and b/docs/store/screenshots/framed/fr/02_feedback.png differ diff --git a/docs/store/screenshots/framed/fr/03_switcher.png b/docs/store/screenshots/framed/fr/03_switcher.png new file mode 100644 index 0000000..282af31 Binary files /dev/null and b/docs/store/screenshots/framed/fr/03_switcher.png differ diff --git a/docs/store/screenshots/framed/fr/04_es_dialogue.png b/docs/store/screenshots/framed/fr/04_es_dialogue.png new file mode 100644 index 0000000..134d903 Binary files /dev/null and b/docs/store/screenshots/framed/fr/04_es_dialogue.png differ diff --git a/docs/store/screenshots/framed/fr/05_ru_dialogue.png b/docs/store/screenshots/framed/fr/05_ru_dialogue.png new file mode 100644 index 0000000..962c66b Binary files /dev/null and b/docs/store/screenshots/framed/fr/05_ru_dialogue.png differ diff --git a/docs/store/screenshots/framed/fr/06_ru_context.png b/docs/store/screenshots/framed/fr/06_ru_context.png new file mode 100644 index 0000000..2e037f4 Binary files /dev/null and b/docs/store/screenshots/framed/fr/06_ru_context.png differ diff --git a/docs/store/screenshots/framed/fr/07_you.png b/docs/store/screenshots/framed/fr/07_you.png new file mode 100644 index 0000000..3291237 Binary files /dev/null and b/docs/store/screenshots/framed/fr/07_you.png differ diff --git a/docs/store/screenshots/framed/fr/08_lessons.png b/docs/store/screenshots/framed/fr/08_lessons.png new file mode 100644 index 0000000..f62e2e8 Binary files /dev/null and b/docs/store/screenshots/framed/fr/08_lessons.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png index defb308..0729fd1 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png index c4f6fe7..35d4dd4 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png index b701a03..f3a7236 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png index 552cc5a..2e8d3e7 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png index e7d95fa..763e556 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png index 30e56f1..10641e6 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/7.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/7.png index 54ee8e5..a4d8ea8 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/7.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/7.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/8.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/8.png new file mode 100644 index 0000000..bf1ec56 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/8.png differ diff --git a/tools/store/README.md b/tools/store/README.md new file mode 100644 index 0000000..3f8ada3 --- /dev/null +++ b/tools/store/README.md @@ -0,0 +1,127 @@ +# Recursos graficos de la ficha de Play + +Los graficos que la ficha de Glosso necesita en Play Console, generados de +forma reproducible desde el emulador: capturas de telefono y tablet (en, es, fr +y de), el icono de la ficha y el grafico destacado. El crudo y lo compuesto +viven bajo `docs/store/`. + +El **texto** de la ficha (titulo, descripciones por locale) es otra cosa y vive en +`docs/store/README.md` + `docs/store/store-listing.csv`; este documento es solo de +los graficos. + +## Que hay en `docs/store/` + +| ruta | que es | +|---|---| +| `screenshots/raw//` | crudo del emulador, 1080x2340, sin UI de debug | +| `screenshots/raw-tablets///` | crudo de tablet (7" y 10") | +| `screenshots/framed//` | capturas disenadas del telefono, 1080x1920 | +| `screenshots/framed-7in//` | capturas disenadas 7", 1200x1920 | +| `screenshots/framed-10in//` | capturas disenadas 10", 1600x2560 | +| `icon-512.png` | icono de la ficha, 512x512 | +| `feature-1024x500.png` | grafico destacado (en) | +| `feature-1024x500.es.png` | grafico destacado (es) | +| `feature-1024x500.fr.png` | grafico destacado (fr) | +| `feature-1024x500.de.png` | grafico destacado (de) | + +Las capturas disenadas son la pantalla real de la app dentro de un marco de movil +dibujado a mano, sobre el fondo de marca, con un titular en Bricolage Grotesque y +Plus Jakarta Sans (las fuentes de la app). El titular cambia por idioma. + +## Como se regenera + +### 1. Build de captura + +El modo de captura oculta la UI de debug (barra de fixtures, atajo de seed del +onboarding, comparador de modelos) y anade un unico objetivo invisible en la +cabecera de practica para inyectar una toma puntuada, porque el emulador no tiene +microfono. Solo debug, apagado por defecto: + +```sh +./gradlew :androidApp:assembleDebug -PglossoStoreScreenshots=true -PglossoDebugReleaseSigning=true +adb -s emulator-5568 install -r androidApp/build/outputs/apk/debug/androidApp-debug.apk +``` + +### 2. Capturar el crudo + +```sh +python3 tools/store/capture.py --serial emulator-5568 --locales en,es,fr,de --device phone +python3 tools/store/capture.py --serial emulator-5568 --locales en,es,fr,de --device tablet7 +python3 tools/store/capture.py --serial emulator-5568 --locales en,es,fr,de --device tablet10 +``` + +El script configura el emulador (resolucion, densidad, tema claro, bateria al +100%, animaciones a 0, volumen de media a 0), limpia los datos de la +app, fija el idioma de la app (`cmd locale set-app-locales`), pone el acento +americano, siembra el perfil demo (`--ez seed_profile_demo true`) y recorre las +pantallas. En telefono abre ademas la leccion del dia: captura su dialogo y, tras +fijar el paso guardado de la leccion (`run-as`, solo debug), el paso que sigue a +los ejercicios. Ese paso es "Tu turno" solo con la interfaz en espanol (los +dialogos solo estan traducidos al espanol); en los otros idiomas es el ejercicio +de pronunciacion, y el titular de `compose.py` lo refleja. En todos los +dispositivos termina en el curso de ruso: cambia el idioma objetivo, guarda una +leccion como la que esta en curso y la abre desde Hoy, para capturar el paso +Contexto (las notas de cultura de "Cinco rosas para Masha", con el ejemplo que +no se dice tachado) y el dialogo de "Entre amigas: Привет y Пока" con la +traduccion visible. Los dialogos se desplazan hasta dejar el boton de +traduccion bajo la etiqueta del paso, para que el encuadre sea igual en los +cuatro idiomas aunque el titulo ocupe una o dos lineas. Requiere la red: la +app es cloud-first, y sin servidor las pantallas de contenido salen con "Couldn't +load". + +### 3. Componer + +```sh +python3 tools/store/compose.py # todo +python3 tools/store/compose.py --only phones,icon,feature +``` + +Usa `rsvg-convert` con un `fontconfig` temporal que expone solo las fuentes de la +app, de modo que los pesos de las fuentes variables salen como en la app. No hay +arte de terceros: el marco es un rectangulo redondeado con la pantalla recortada +dentro. + + +## Requisitos + +- `adb` en el PATH y un emulador permitido (`5558`, `5560`, `5562`, `5568`, + `5570`), por ejemplo `emulator -avd -port 5568`. Nunca el movil del dueno. +- `rsvg-convert`, `magick` y `python3`. +- Build de captura instalada (paso 1). + +## Checklist de Play + +Formato y limites de Play Console (revisar contra la ayuda vigente antes de +subir): + +- [ ] **Icono**: `icon-512.png`, 512x512, PNG de 32 bits, sin esquinas + redondeadas ni insignias (Play aplica su propia mascara). +- [ ] **Grafico destacado**: `feature-1024x500.png` (y `.es.png`, `.fr.png`, + `.de.png`), 1024x500, opaco (sin transparencia), sin insignias ni botones de + "instalar". +- [ ] **Telefono**: 2 a 8 capturas de `screenshots/framed//`, 1080x1920 + (9:16). +- [ ] **Tablet 7"**: 2 a 8 capturas de `screenshots/framed-7in//`, + 1200x1920. +- [ ] **Tablet 10"**: 2 a 8 capturas de `screenshots/framed-10in//`, + 1600x2560. +- [ ] **Idiomas**: subir el juego `en`, el `es`, el `fr` y el `de` en su ficha de + idioma. +- [ ] **Contenido**: sin promesas ajenas a la app, sin precios ni "gratis para + siempre" en el grafico, sin capturas de dispositivos de terceros. +- [ ] **Textos de la ficha**: titulo, descripcion corta y larga alineados con + `docs/PRODUCT_LIFECYCLE.md` y `docs/PRODUCT-CONFIG.md` (fase beta). + +## Notas + +- Las capturas se toman en tema claro (dia). El tema tinta es la misma app; si + hace falta un juego oscuro, repetir la captura forzando `ui_night_mode=2`. +- El crudo incluye la barra de estado y, en tablet, la taskbar del emulador; la + composicion recorta ambas para que no aparezca nada que no sea la app. + +## Texto de Play + +`fastlane/metadata/android/` es la ficha de F-Droid. La de Play tiene textos +propios, copiados tal como estan publicados en `docs/store/play-listing//`. +Para subir: una carpeta de `supply` con esos textos, `changelogs/.txt` +de fastlane y `images/phoneScreenshots/` desde `framed//`. diff --git a/tools/store/capture.py b/tools/store/capture.py new file mode 100644 index 0000000..43a972c --- /dev/null +++ b/tools/store/capture.py @@ -0,0 +1,603 @@ +#!/usr/bin/env python3 +"""Drive the Glosso debug build on an emulator and capture the store raws. + +This is the reproducible half of the store assets: it configures a permitted +emulator, walks the app through the screens the listing shows, and writes one +PNG per screen to `docs/store/screenshots/raw//`. The composed (framed, +headline-bearing) assets are produced separately by `compose.py`. + +Requirements: + - `:androidApp` debug build with the store-capture flag: + ./gradlew :androidApp:assembleDebug -PglossoStoreScreenshots=true \ + -PglossoDebugReleaseSigning=true + - the APK installed on the target emulator + - `adb` on PATH (or ANDROID_HOME set) + +Device rule: only the emulators 5558, 5560, 5562, 5568 and +5570 are ever touched; the owner's phone and 5554/5556 are never used. + +Usage: + python3 tools/store/capture.py [--serial emulator-5568] [--locales en,es,fr,de] + [--device phone|tablet7|tablet10] +""" +from __future__ import annotations + +import argparse +import os +import re +import subprocess +import sys +import time +import xml.etree.ElementTree as ET +from pathlib import Path + +REPO = Path(__file__).resolve().parents[2] +PKG = "me.shirobyte42.glosso" +ACTIVITY = f"{PKG}/com.glosso.app.MainActivity" +RAW = REPO / "docs/store/screenshots/raw" +RAW_TABLETS = REPO / "docs/store/screenshots/raw-tablets" + +# Emulator geometry: pixel size, density, and the labels below. +GEOMETRY = { + "phone": ("1080x2340", 480), + "tablet7": ("1200x1920", 240), + "tablet10": ("1600x2560", 320), +} + +# Strings that mark a screen has settled, per locale. +# Strings that mark a screen has settled, per locale. They are picked so they +# do not collide with the persistent bottom-bar labels (which would make a wait +# succeed on any screen). +MARKERS = { + "en": { + "onboarding": "Learn the language", + "today": "Your lesson", + "practice": "Your practice", + "feedback": "Next exercise", + "you": "Pronunciation", + "lessons": "Start here", + "library": "Free practice", + "stories": "A2 ·", + "story": "Paragraph", + "dialogue": "Read or listen", + "speak": "Your turn", + "context": "Not said", + }, + "es": { + "onboarding": "Aprende el idioma", + "today": "Tu lección", + "practice": "Tu práctica", + "feedback": "Siguiente", + "you": "Pronunciaci", + "lessons": "Empieza", + "library": "Práctica libre", + "stories": "A2 ·", + "story": "Párrafo", + "dialogue": "Lee o escucha", + "speak": "Tu turno", + "context": "No se dice", + }, + "fr": { + "onboarding": "Apprends la langue", + "today": "Ta leçon", + "practice": "Votre entraînement", + "feedback": "Exercice suivant", + "you": "Prononciation", + "lessons": "Commence ici", + "library": "Entraînement libre", + "stories": "A2 ·", + "story": "Paragraphe", + "dialogue": "Lis ou écoute", + "speak": "À toi", + "context": "Ne se dit pas", + }, + "de": { + "onboarding": "Lerne die Sprache", + "today": "Deine Lektion", + "practice": "Dein Üben", + "feedback": "Nächste Übung", + "you": "Aussprache", + "lessons": "Hier starten", + "library": "Freies Üben", + "stories": "A2 ·", + "story": "Absatz", + "dialogue": "Lies oder höre", + "speak": "Du bist dran", + "context": "Sagt man nicht", + }, +} + +# Tap targets are the same layout across locales; text is not needed. Normalised +# to the phone geometry and rescaled per device. +def taps(w: int, h: int) -> dict[str, tuple[int, int]]: + def p(fx: float, fy: float) -> tuple[int, int]: + return int(w * fx), int(h * fy) + return { + "nav_today": p(0.125, 0.9479), + "nav_lessons": p(0.375, 0.9479), + "nav_you": p(0.625, 0.9479), + "nav_library": p(0.875, 0.9479), + "library_practice": p(0.5, 0.2991), + "library_stories": p(0.5, 0.4218), + "story_first": p(0.5, 0.2991), + "onboarding_skip": p(0.885, 0.1047), + "practice_inject": p(0.9111, 0.0893), + "back": p(0.0889, 0.0893), + } + + +def adb(serial: str, *args: str, check: bool = True) -> str: + res = subprocess.run(["adb", "-s", serial, *args], capture_output=True, text=True) + if check and res.returncode != 0: + raise RuntimeError(f"adb {' '.join(args)} failed: {res.stderr.strip()}") + return res.stdout + + +def screencap(serial: str, path: Path) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + with open(path, "wb") as fh: + subprocess.run(["adb", "-s", serial, "exec-out", "screencap", "-p"], stdout=fh, check=True) + + +def nodes(serial: str) -> list[tuple[str, int, int]]: + # uiautomator refuses to dump while the window is still settling; retry a + # few times and treat a persistent failure as "no nodes" rather than dying, + # so a flaky dump never aborts a whole capture run. + xml = "" + for _ in range(4): + out = adb(serial, "shell", "uiautomator", "dump", "/sdcard/ui.xml", check=False) + if "UI hierchary dumped to" in out or "dumped to" in out: + xml = adb(serial, "shell", "cat", "/sdcard/ui.xml", check=False) + if xml.strip().startswith(" tuple[int, int] | None: + needle = needle.lower() + for text, x, y in nodes(serial): + if needle in text.lower(): + return x, y + return None + + +def wait_for(serial: str, needle: str, timeout: float = 20.0) -> bool: + end = time.time() + timeout + while time.time() < end: + if find_text(serial, needle): + return True + time.sleep(0.6) + return False + + +def tap(serial: str, xy: tuple[int, int]) -> None: + adb(serial, "shell", "input", "tap", str(xy[0]), str(xy[1])) + + +def tap_bottom(serial: str, label: str) -> bool: + """Tap the lowest node whose text is [label] (the bottom-bar item, not a title).""" + hits = [n for n in nodes(serial) if n[0].lower() == label.lower()] + if not hits: + hits = [n for n in nodes(serial) if label.lower() in n[0].lower()] + if not hits: + return False + _, x, y = max(hits, key=lambda n: n[2]) + tap(serial, (x, y)) + return True + + +def tap_text(serial: str, label: str) -> bool: + hit = find_text(serial, label) + if not hit: + return False + tap(serial, hit) + return True + + +def tap_right_of(serial: str, label: str, offset: int) -> bool: + """Tap [offset] px right of the right edge of the node that shows [label].""" + adb(serial, "shell", "uiautomator", "dump", "/sdcard/ui.xml", check=False) + xml = adb(serial, "shell", "cat", "/sdcard/ui.xml", check=False) + try: + root = ET.fromstring(xml) + except ET.ParseError: + return False + for n in root.iter("node"): + text = (n.get("text") or n.get("content-desc") or "").strip() + if label.lower() not in text.lower(): + continue + m = re.match(r"\[(\d+),(\d+)\]\[(\d+),(\d+)\]", n.get("bounds") or "") + if not m: + continue + x1, y1, x2, y2 = map(int, m.groups()) + tap(serial, (x2 + offset, (y1 + y2) // 2)) + return True + return False + + +def goto(serial: str, xy: tuple[int, int], marker: str, tries: int = 4, timeout: float = 8.0) -> bool: + """Tap [xy] until [marker] is on screen. + + The app is cloud-first, so a first tap can land while a list is still + loading and open nothing. Retapping the same target is safe on every + navigation control used here and makes the run independent of that timing. + """ + for _ in range(tries): + tap(serial, xy) + if wait_for(serial, marker, timeout): + return True + return False + + +def setup(serial: str, device: str) -> None: + size, density = GEOMETRY[device] + adb(serial, "root", check=False) + time.sleep(1) + adb(serial, "wait-for-device", check=False) + adb(serial, "shell", "wm", "size", size) + adb(serial, "shell", "wm", "density", str(density)) + # Landscape is never used: keep the capture upright whatever the sensor says. + adb(serial, "shell", "settings", "put", "system", "accelerometer_rotation", "0") + adb(serial, "shell", "settings", "put", "system", "user_rotation", "0") + # The listing is shot in the daylight theme; the ink theme is a separate need. + # Both the runtime override and the persisted secure value are set: some + # configuration changes reload the latter and would put the app back in ink. + adb(serial, "shell", "cmd", "uimode", "night", "no") + adb(serial, "shell", "settings", "put", "secure", "ui_night_mode", "1", check=False) + # Final states only: no half-played animations in a screenshot. + for scale in ("window_animation_scale", "transition_animation_scale", "animator_duration_scale"): + adb(serial, "shell", "settings", "put", "global", scale, "0") + adb(serial, "shell", "svc", "power", "stayon", "true") + # The capture drive never plays audio; keep the emulator silent anyway so + # nothing can leak to the host speakers. + adb(serial, "shell", "cmd", "media_session", "volume", "--stream", "3", "--set", "0", check=False) + # A clean, deliberate status bar: full battery, a fixed morning time. + adb(serial, "shell", "dumpsys", "battery", "set", "level", "100", check=False) + adb(serial, "shell", "dumpsys", "battery", "set", "ac", "1", check=False) + adb(serial, "shell", "dumpsys", "battery", "set", "status", "5", check=False) + # Real time: a fixed fake date breaks TLS, and the status bar is cropped anyway. + adb(serial, "shell", "settings", "put", "global", "auto_time", "1", check=False) + time.sleep(2) + + +def set_locale(serial: str, locale: str) -> None: + adb(serial, "shell", "cmd", "locale", "set-app-locales", PKG, "--locales", locale, check=False) + + +def launch(serial: str, seed: bool = False) -> None: + adb(serial, "shell", "am", "force-stop", PKG) + time.sleep(1) + args = ["shell", "am", "start", "-n", ACTIVITY] + if seed: + args += ["--ez", "seed_profile_demo", "true"] + adb(serial, *args) + dismiss_consent(serial) + + +def dismiss_consent(serial: str, timeout: float = 6.0) -> None: + """Declines the usage-consent question if it opens over the first screen. + + Matched exactly: the dialog's body text also contains the button's word. + """ + words = {labels["decline"].lower() for labels in LABELS.values()} + end = time.time() + timeout + while time.time() < end: + hits = [n for n in nodes(serial) if n[0].lower() in words] + if hits: + tap(serial, (hits[0][1], hits[0][2])) + time.sleep(1.0) + return + time.sleep(0.6) + + +def write_pref(serial: str, name: str, values: dict[str, str]) -> None: + """Sets string values in one of the app's preference files (debug build, `run-as`). + + The app has to be stopped: it keeps its preferences in memory and would write + the old values back. + """ + path = f"shared_prefs/{name}.xml" + current = adb(serial, "shell", "run-as", PKG, "cat", path, check=False) + entries = dict(re.findall(r'([^<]*)', current)) + entries.update(values) + others = [line for line in current.splitlines() + if line.strip().startswith("<") and "{v}\n' for k, v in entries.items()) + xml = ("\n\n" + + body + "".join(line + "\n" for line in others) + "\n") + subprocess.run(["adb", "-s", serial, "shell", "run-as", PKG, "sh", "-c", f"'cat > {path}'"], + input=xml.encode("utf-8"), check=True) + + +def raw_dir(locale: str, device: str) -> Path: + return (RAW / locale) if device == "phone" else (RAW_TABLETS / device / locale) + + +def shoot(serial: str, locale: str, device: str, name: str) -> None: + # Guard against the theme drifting back to ink between screens; writing the + # value it already has is a no-op, so this never adds a visible flash. + if adb(serial, "shell", "settings", "get", "secure", "ui_night_mode", check=False).strip() != "1": + adb(serial, "shell", "cmd", "uimode", "night", "no", check=False) + adb(serial, "shell", "settings", "put", "secure", "ui_night_mode", "1", check=False) + time.sleep(1.0) + path = raw_dir(locale, device) / f"{name}.png" + screencap(serial, path) + print(f" captured {path.relative_to(REPO)}") + + +# The Russian lessons the listing shows: one whose first note is short and +# cultural (flowers are given in odd numbers, with the even bunch crossed out), +# and the "Привет / Как дела?" dialogue between two friends. +RU_CONTEXT_LESSON = "ru.lesson.invitations.002" +RU_DIALOGUE_LESSON = "ru.lesson.greetings.002" +# The first Spanish lesson: greetings at a café, with its illustration. +ES_DIALOGUE_LESSON = "es.lesson.greetings.001" + + +def drag(serial: str, x: int, y_from: int, y_to: int) -> None: + """Scrolls by exactly (y_from - y_to): a drag that rests before lifting. + + `input swipe` lifts the finger while still moving, so the list flings past + the target; holding still before UP leaves no velocity to fling with. + """ + if abs(y_from - y_to) < 40: + return + steps = 12 + moves = "; ".join(f"input motionevent MOVE {x} {y_from + (y_to - y_from) * i // steps}" + for i in range(1, steps + 1)) + adb(serial, "shell", f"input motionevent DOWN {x} {y_from}; {moves}; sleep 0.5; " + f"input motionevent UP {x} {y_to}") + + +def anchor_under_step(serial: str, label: str, step_marker: str, density: int, w: int, h: int) -> None: + """Scrolls a lesson dialogue so its translation toggle sits under the step label. + + The lesson title takes one or two lines depending on the interface + language, so a fixed swipe would leave the list at a different place in + each locale (half a card, or the toggle cut by the edge fade). Anchoring + the toggle gives every locale the same framing: toggle, then the lines. + """ + toggle = find_text(serial, label) + if not toggle: + # Below the fold (a lesson with a cover image): bring it up first. + drag(serial, w // 2, int(h * 0.75), int(h * 0.35)) + time.sleep(1.0) + toggle = find_text(serial, label) + step = find_text(serial, step_marker) + if not (toggle and step): + return + target = step[1] + int(130 * density / 480) + drag(serial, w // 2, int(h * 0.75), int(h * 0.75) - (toggle[1] - target)) + time.sleep(1.0) + + +def open_course_lesson(serial: str, language: str, lesson_id: str, labels: dict) -> None: + """Switches the course to [language] and opens [lesson_id] from its start, from Today.""" + adb(serial, "shell", "am", "force-stop", PKG) + write_pref(serial, "glosso_language", {"target_language": language}) + write_pref(serial, "glosso_progress", {"lesson_id": lesson_id, "lesson_step": "BASE", + "resume_level": "A1"}) + launch(serial) + # The Today card shows its button only once the Russian course has loaded. + wait_for(serial, labels["continue"], 25) + time.sleep(1.0) + tap_text(serial, labels["continue"]) + + +# Text used to drive navigation when the layout is not the phone's. Tapping the +# label itself is layout-independent, which the bottom bar and the Library cards +# both allow. +LABELS = { + "en": {"skip": "Skip", "practice": "Free practice", "back": "Back", + "today": "Today", "lessons": "Lessons", "you": "You", "library": "Library", + "start": "Start", "continue": "Continue", "translation": "Show translation", "hide": "Hide translation", + "decline": "Decline", "switcher": "Target language"}, + "es": {"skip": "Saltar", "practice": "Práctica libre", "back": "Atrás", + "today": "Hoy", "lessons": "Lecciones", "you": "Tú", "library": "Biblioteca", + "start": "Empezar", "continue": "Continuar", "translation": "Ver traducción", "hide": "Ocultar traducción", + "decline": "Rechazar", "switcher": "Idioma objetivo"}, + "fr": {"skip": "Passer", "practice": "Entraînement libre", "back": "Retour", + "today": "Aujourd'hui", "lessons": "Leçons", "you": "Toi", "library": "Bibliothèque", + "start": "Commencer", "continue": "Continuer", "translation": "Voir la traduction", "hide": "Masquer la traduction", + "decline": "Refuser", "switcher": "Langue étudiée"}, + "de": {"skip": "Überspringen", "practice": "Freies Üben", "back": "Zurück", + "today": "Heute", "lessons": "Lektionen", "you": "Du", "library": "Bibliothek", + "start": "Starten", "continue": "Weiter", "translation": "Übersetzung anzeigen", "hide": "Übersetzung ausblenden", + "decline": "Ablehnen", "switcher": "Zielsprache"}, +} + + +def capture_locale(serial: str, locale: str, device: str, density: int, taps_: dict) -> None: + marker = MARKERS[locale] + labels = LABELS[locale] + phone = device == "phone" + # Half a 48dp touch target, in px: the practice header's invisible inject + # target sits right after the title, whatever the density. + inject_offset = int(24 * density / 160) + print(f"[{locale}] start ({device})") + # Fresh install state: the welcome is the first screen and is captured as is. + # The per-app locale is set *after* the clear: `pm clear` wipes the override, + # so setting it first would leave the run in the system language. + adb(serial, "shell", "pm", "clear", PKG) + time.sleep(1) + set_locale(serial, locale) + time.sleep(1) + launch(serial) + wait_for(serial, marker["onboarding"], 25) + shoot(serial, locale, device, "onboarding") + + # Past the welcome, with the documented multi-day profile seeded, so the + # progress and "weakest sounds" views carry real numbers. On a tablet the + # top bar sits further in, so the welcome's Skip is found by its label. + if phone: + tap(serial, taps_["onboarding_skip"]) + else: + tap_text(serial, labels["skip"]) + time.sleep(1) + # The listing shows the American course: its wording and voices are the + # newest part of the product, and en-US is the listing's base language. + adb(serial, "shell", "am", "force-stop", PKG) + write_pref(serial, "glosso_voice", {"accent": "en-US"}) + launch(serial, seed=True) + if not wait_for(serial, marker["today"], 25): + # The seed launch is the gate for the whole run: without it the app + # stays on onboarding and every later tap lands on the wrong screen. + # Fail here rather than write a set of wrong screenshots. + raise RuntimeError(f"{locale}: 'today' never settled after seeding; capture aborted") + + # Free practice first: it is the product's core claim, and the scored take + # also lights the streak that the later Today and Lessons shots show. + if phone: + goto(serial, taps_["nav_library"], marker["library"]) + goto(serial, taps_["library_practice"], marker["practice"]) + else: + tap_bottom(serial, labels["library"]); time.sleep(1.0) + tap_text(serial, labels["practice"]); wait_for(serial, marker["practice"], 12) + shoot(serial, locale, device, "practice") + + # Scored take. The store build exposes one invisible tap target in the + # practice header for exactly this; nothing debug is ever on screen. + if phone: + goto(serial, taps_["practice_inject"], marker["feedback"], tries=2, timeout=9.0) + else: + tap_right_of(serial, marker["practice"], inject_offset) + wait_for(serial, marker["feedback"], 12) + time.sleep(5) + shoot(serial, locale, device, "feedback") + + # Back out of the practice route: every Library sub-screen owns the whole + # window, so the bottom bar is not there to tap until we leave it. + if phone: + tap(serial, taps_["back"]) + else: + tap_text(serial, labels["back"]) + time.sleep(1.5) + + # Today now carries the streak the scored take just earned. + if phone: + goto(serial, taps_["nav_today"], marker["today"]) + else: + tap_bottom(serial, labels["today"]); wait_for(serial, marker["today"], 12) + shoot(serial, locale, device, "today") + + # The course switcher in the header, open over Today. + tap_text(serial, labels["switcher"]) + time.sleep(1.5) + shoot(serial, locale, device, "switcher") + adb(serial, "shell", "input", "keyevent", "4") + time.sleep(1.0) + + if phone: + # The lesson of the day: its dialogue, then the step where the learner + # answers from memory. The step is reached by setting the saved lesson + # step, so the run does not depend on solving the exercises in between. + tap_text(serial, labels["start"]) + wait_for(serial, marker["dialogue"], 15) + time.sleep(1.0) + w, h = (int(v) for v in GEOMETRY[device][0].split("x")) + anchor_under_step(serial, labels["translation"], marker["dialogue"], density, w, h) + shoot(serial, locale, device, "dialogue") + adb(serial, "shell", "am", "force-stop", PKG) + write_pref(serial, "glosso_progress", {"lesson_step": "SPEAK"}) + launch(serial) + wait_for(serial, marker["today"], 25) + # The Today card already names the step, so the label cannot tell the + # two screens apart: the lesson is given time to open instead. + tap_text(serial, labels["continue"]) + time.sleep(4.0) + shoot(serial, locale, device, "speak") + tap(serial, taps_["back"]) + time.sleep(1.5) + + # Progress: the pronunciation profile with its per-sound trend. + if phone: + goto(serial, taps_["nav_you"], marker["you"]) + else: + tap_bottom(serial, labels["you"]); wait_for(serial, marker["you"], 12) + shoot(serial, locale, device, "you") + + # Lessons. + if phone: + goto(serial, taps_["nav_lessons"], marker["lessons"]) + else: + tap_bottom(serial, labels["lessons"]); wait_for(serial, marker["lessons"], 12) + shoot(serial, locale, device, "lessons") + + if phone: + # The Library hub, then the story bank and a reader. The run ends in the + # reader, which has no bottom bar, so nothing is navigated after this. + goto(serial, taps_["nav_library"], marker["library"]) + shoot(serial, locale, device, "library") + goto(serial, taps_["library_stories"], marker["stories"]) + shoot(serial, locale, device, "stories") + goto(serial, taps_["story_first"], marker["story"], tries=2, timeout=8.0) + time.sleep(1.0) + shoot(serial, locale, device, "story") + + # The Russian course: a lesson opened from its start sets the scene with + # its culture notes (the "Context" step) before its dialogue, shown with + # the meaning in the interface language because the learner cannot read + # Russian yet. Each lesson is picked by saving it as the one in progress. + w, h = (int(v) for v in GEOMETRY[device][0].split("x")) + open_course_lesson(serial, "ru", RU_CONTEXT_LESSON, labels) + wait_for(serial, marker["context"], 15) + time.sleep(1.0) + shoot(serial, locale, device, "ru_context") + + for language, lesson_id, name in (("ru", RU_DIALOGUE_LESSON, "ru_dialogue"), + ("es", ES_DIALOGUE_LESSON, "es_dialogue")): + open_course_lesson(serial, language, lesson_id, labels) + # Lessons with culture notes open on them; the dialogue is the next step. + # The context step can mention the dialogue's label too, so its own + # marker decides whether the dialogue is really on screen yet. + wait_for(serial, marker["dialogue"], 15) + for _ in range(3): + if find_text(serial, marker["dialogue"]) and not find_text(serial, marker["context"]): + break + tap_text(serial, labels["continue"]) + time.sleep(2.0) + time.sleep(1.0) + tap_text(serial, labels["translation"]) + time.sleep(1.5) + anchor_under_step(serial, labels["hide"], marker["dialogue"], density, w, h) + shoot(serial, locale, device, name) + print(f"[{locale}] done") + + +def main() -> None: + ap = argparse.ArgumentParser() + ap.add_argument("--serial", default=os.environ.get("ANDROID_SERIAL", "emulator-5568")) + ap.add_argument("--locales", default="en,es,fr,de") + ap.add_argument("--device", default="phone", choices=sorted(GEOMETRY)) + args = ap.parse_args() + + if args.serial not in {"emulator-5558", "emulator-5560", "emulator-5562", + "emulator-5568", "emulator-5570"}: + sys.exit(f"refusing to touch {args.serial}: not a permitted emulator") + + size, density = GEOMETRY[args.device] + w, h = (int(v) for v in size.split("x")) + taps_ = taps(w, h) + setup(args.serial, args.device) + for locale in args.locales.split(","): + locale = locale.strip() + if locale: + capture_locale(args.serial, locale, args.device, density, taps_) + + +if __name__ == "__main__": + main() diff --git a/tools/store/compose.py b/tools/store/compose.py new file mode 100644 index 0000000..b54ec32 --- /dev/null +++ b/tools/store/compose.py @@ -0,0 +1,510 @@ +#!/usr/bin/env python3 +"""Compose the Play listing graphics from the raw captures. + +These outputs, all deterministic from the raw captures: + + - framed//NN_.png phone, 1080x1920 + - framed-7in//NN_.png 7-inch tablet, 1200x1920 + - framed-10in//NN_.png 10-inch tablet, 1600x2560 + - icon-512.png the launcher icon, square, no badges + - feature-1024x500[.].png the feature graphic, opaque, no badges + +The device mockup is drawn by hand (rounded rect + screen clipped into it); no +third-party device art is used, so there is nothing to attribute. Text is laid +out as SVG and rasterised with `rsvg-convert`, which is the only renderer here +that honours the variable fonts' weights through fontconfig. + +Usage: + python3 tools/store/compose.py [--locale en,es,fr,de] [--only phones,tablets,icon,feature] +""" +from __future__ import annotations + +import argparse +import base64 +import os +import re +import subprocess +import tempfile +from pathlib import Path + +REPO = Path(__file__).resolve().parents[2] +FONTS = REPO / "shared/src/commonMain/composeResources/font" +RAW = REPO / "docs/store/screenshots/raw" +RAW_TABLETS = REPO / "docs/store/screenshots/raw-tablets" +OUT = REPO / "docs/store" + +# Brand palette, kept in step with docs/BRAND.md and GlossoColor.kt. +INK = "#0B0B0E" +INK_DEEP = "#14142E" +COBALT = "#3D51E0" +COBALT_LIGHT = "#93A4FF" +TEXT = "#F4F4F6" +MUTED = "#A3A3AE" + +BY_FAMILY = { + "display": "Bricolage Grotesque", + "ui": "Plus Jakarta Sans", +} + +# One headline per screen, per locale. The order of PHONES is the order the +# listing shows them in; the first is the one that has to carry the promise. +HEADLINES = { + "en": { + "onboarding": ("Learn the language. Pronounce it well.", "A course built around your own voice."), + "today": ("Your lesson, ready every day.", "Built from the sounds that resist you."), + "practice": ("Speak. Get measured.", "Real pronunciation scoring, sound by sound."), + "feedback": ("See exactly which sound slipped.", "Scores down to the phoneme, not a vibe."), + "you": ("Watch a weak sound become a strength.", "Your own trend, from your own takes."), + "lessons": ("A real course, from A1 up.", "Dialogues, articles and drills that build."), + "story": ("Read and hear real English.", "Tap any word for its sound and meaning."), + "stories": ("A library that grows with you.", "Short pieces to read and hear, at your level."), + "dialogue": ("Real conversations, line by line.", "In American or British English, your choice."), + "speak": ("Your turn: say it from memory.", "Hear the line, then answer in English yourself."), + "library": ("Stories, exercises and free practice.", "Everything that is not a lesson."), + "ru_dialogue": ("Now in Russian, too.", "Everyday dialogues, with the meaning in your language."), + "ru_context": ("Learn the culture, not just the words.", "New Russian A1: what is done, and what is not."), + "switcher": ("Three courses, one tap away.", "English, Russian and Spanish. Switch any time."), + "es_dialogue": ("Now in Spanish, too.", "A new A1 course from Spain, with the meaning in your language."), + }, + "es": { + "onboarding": ("Aprende el idioma. Pronúncialo bien.", "Un curso hecho con tu propia voz."), + "today": ("Tu lección, lista cada día.", "Hecha con los sonidos que se te resisten."), + "practice": ("Habla. Te medimos.", "Nota de pronunciación real, sonido a sonido."), + "feedback": ("Mira qué sonido se te escapó.", "Nota por fonema, no una impresión."), + "you": ("Mira cómo un sonido débil se hace fuerte.", "Tu tendencia, con tus propias tomas."), + "lessons": ("Un curso de verdad, desde A1.", "Diálogos, artículos y ejercicios que suman."), + "story": ("Lee y escucha inglés real.", "Toca una palabra y oye su sonido."), + "stories": ("Una biblioteca que crece contigo.", "Textos cortos para leer y escuchar."), + "dialogue": ("Conversaciones reales, línea a línea.", "En inglés americano o británico, tú eliges."), + "speak": ("Tu turno: dilo de memoria.", "Escuchas la frase y respondes tú en inglés."), + "library": ("Historias, ejercicios y práctica libre.", "Todo lo que no es una lección."), + "ru_dialogue": ("Ahora también en ruso.", "Diálogos del día a día, con su traducción."), + "ru_context": ("Aprende la cultura, no solo las palabras.", "Nuevo ruso A1: lo que se hace y lo que no."), + "switcher": ("Tres cursos, a un toque.", "Inglés, ruso y español. Cambia cuando quieras."), + "es_dialogue": ("Ahora también en español.", "Nuevo curso A1 de España, con la traducción en tu idioma."), + }, + "fr": { + "onboarding": ("Apprenez la langue. Prononcez-la bien.", "Un cours construit autour de votre voix."), + "today": ("Votre leçon, prête chaque jour.", "Faite à partir des sons qui vous résistent."), + "practice": ("Parlez. On vous mesure.", "Une note de prononciation réelle, son par son."), + "feedback": ("Voyez quel son vous a échappé.", "Une note par phonème, pas une impression."), + "you": ("Voyez un son faible devenir fort.", "Votre tendance, à partir de vos prises."), + "lessons": ("Un vrai cours, dès le niveau A1.", "Dialogues, articles et exercices qui s'enchaînent."), + "story": ("Lisez et écoutez de l'anglais réel.", "Touchez un mot pour l'entendre et le comprendre."), + "stories": ("Une bibliothèque qui grandit avec vous.", "Des textes courts à lire et écouter, à votre niveau."), + "dialogue": ("De vraies conversations, ligne par ligne.", "En anglais américain ou britannique, à vous de choisir."), + "speak": ("À vous : dites-le de mémoire.", "Écoutez la réplique, puis répondez en anglais."), + "library": ("Histoires, exercices et entraînement libre.", "Tout ce qui n'est pas une leçon."), + "ru_dialogue": ("Maintenant aussi en russe.", "Des dialogues du quotidien, traduits dans votre langue."), + "ru_context": ("Apprenez la culture, pas seulement les mots.", "Nouveau russe A1 : ce qui se fait, et ce qui ne se fait pas."), + "switcher": ("Trois cours, à portée de doigt.", "Anglais, russe et espagnol. Changez quand vous voulez."), + "es_dialogue": ("Maintenant en espagnol aussi.", "Nouveau cours A1 d'Espagne, traduit dans votre langue."), + }, + "de": { + "onboarding": ("Lerne die Sprache. Sprich sie richtig aus.", "Ein Kurs rund um deine eigene Stimme."), + "today": ("Deine Lektion, jeden Tag bereit.", "Gebaut aus den Lauten, die dir schwerfallen."), + "practice": ("Sprich. Wir messen dich.", "Echte Aussprachebewertung, Laut für Laut."), + "feedback": ("Sieh genau, welcher Laut danebenging.", "Bewertung pro Phonem, kein Gefühl."), + "you": ("Sieh, wie ein schwacher Laut stark wird.", "Dein Trend, aus deinen eigenen Aufnahmen."), + "lessons": ("Ein echter Kurs, ab A1.", "Dialoge, Artikel und Übungen, die aufbauen."), + "story": ("Lies und höre echtes Englisch.", "Tippe ein Wort an für Laut und Bedeutung."), + "stories": ("Eine Bibliothek, die mit dir wächst.", "Kurze Texte zum Lesen und Hören, auf deinem Niveau."), + "dialogue": ("Echte Gespräche, Zeile für Zeile.", "In amerikanischem oder britischem Englisch, du wählst."), + "speak": ("Du bist dran: Sag es aus dem Kopf.", "Hör den Satz und antworte selbst auf Englisch."), + "library": ("Geschichten, Übungen und freies Üben.", "Alles, was keine Lektion ist."), + "ru_dialogue": ("Jetzt auch auf Russisch.", "Alltagsdialoge, übersetzt in deine Sprache."), + "ru_context": ("Lerne die Kultur, nicht nur Wörter.", "Neu: Russisch A1, was sich gehört und was nicht."), + "switcher": ("Drei Kurse, ein Tipp entfernt.", "Englisch, Russisch und Spanisch. Jederzeit wechseln."), + "es_dialogue": ("Jetzt auch auf Spanisch.", "Neuer A1-Kurs aus Spanien, mit Übersetzung."), + }, +} + +# Which raw screen backs each framed phone shot, in listing order. The welcome +# screen is left out on purpose: it repeats the headline verbatim. +# Play takes at most eight: the practice screen and the story list gave their +# place to the lesson dialogue and the "Your turn" step, and the story reader +# and the Library hub to the Russian course (its dialogue and its culture notes). +PHONES = ["today", "feedback", "switcher", "es_dialogue", "ru_dialogue", "ru_context", "you", "lessons"] + +# Tablets show the same design over a shorter, more representative set. +TABLETS = ["today", "feedback", "switcher", "es_dialogue", "ru_dialogue", "you", "lessons"] + + +def fontconfig() -> tuple[Path, Path]: + """A throwaway fontconfig that exposes only the app's own fonts.""" + tmp = Path(tempfile.mkdtemp(prefix="glosso-store-fc-")) + cache = tmp / "cache" + cache.mkdir() + conf = tmp / "fonts.conf" + conf.write_text( + '\n' + '\n' + "\n" + f" {FONTS}\n" + f" {cache}\n" + "\n" + ) + return conf, tmp + + +def render(svg: str, out: Path, w: int, h: int, fc: Path) -> None: + out.parent.mkdir(parents=True, exist_ok=True) + with tempfile.NamedTemporaryFile("w", suffix=".svg", delete=False) as fh: + fh.write(svg) + svg_path = fh.name + env = dict(os.environ, FONTCONFIG_FILE=str(fc)) + subprocess.run(["rsvg-convert", "-w", str(w), "-h", str(h), svg_path, "-o", str(out)], + check=True, env=env) + os.unlink(svg_path) + print(f" wrote {out.relative_to(REPO)}") + + +XML_ESCAPE = {"&": "&", "<": "<", ">": ">"} + + +def _esc(text: str) -> str: + for k, v in XML_ESCAPE.items(): + text = text.replace(k, v) + return text + + +_measure_fc: Path | None = None + + +def text_width(text: str, size: float, weight: int, family: str, spacing: float, fc: Path) -> float: + """Ink width of one line, measured by rendering it and trimming the result. + + rsvg honours the variable fonts' weights, so this is the same shape the + composed SVG will draw; measuring the metrics by hand would drift. + """ + svg = ( + f'' + f'{_esc(text)}' + ) + with tempfile.NamedTemporaryFile("w", suffix=".svg", delete=False) as fh: + fh.write(svg) + path = fh.name + png = path + ".png" + env = dict(os.environ, FONTCONFIG_FILE=str(fc)) + subprocess.run(["rsvg-convert", "-w", "4000", path, "-o", png], check=True, env=env) + out = subprocess.run(["magick", png, "-background", "none", "-trim", "-format", "%w", "info:"], + capture_output=True, text=True, check=True).stdout.strip() + os.unlink(path) + os.unlink(png) + return float(out or 0) + + +def wrap(text: str, size: float, weight: int, family: str, spacing: float, + max_w: float, fc: Path) -> list[str]: + """Greedy word wrap that never lets a line exceed [max_w].""" + words = text.split() + lines: list[str] = [] + current = "" + for word in words: + candidate = f"{current} {word}".strip() + if current and text_width(candidate, size, weight, family, spacing, fc) > max_w: + lines.append(current) + current = word + else: + current = candidate + if current: + lines.append(current) + return lines + + +_crop_dir: Path | None = None + +# Per-device frame recipe. The emulator status bar carries icons that are not +# the app's (a VPN shield, a microphone, an avatar) plus a "3G" tag, and the +# large-screen emulator adds a system taskbar: both are cropped out so the +# mockup shows the app and nothing of the emulator. Sizes are the ones Play +# asks for: 1080x1920 phone, 1200x1920 7-inch, 1600x2560 10-inch. +DEVICES = { + "phone": dict(canvas=(1080, 1920), raw=(1080, 2340), crop_top=118, crop_bottom=0, + content_frac=0.559, gutter_frac=0.078, head_frac=0.0685, out="framed"), + "tablet7": dict(canvas=(1200, 1920), raw=(1200, 1920), crop_top=72, crop_bottom=112, + content_frac=0.62, gutter_frac=0.078, head_frac=0.0685, out="framed-7in"), + "tablet10": dict(canvas=(1600, 2560), raw=(1600, 2560), crop_top=96, crop_bottom=150, + content_frac=0.62, gutter_frac=0.078, head_frac=0.0685, out="framed-10in"), +} + + +def cropped(path: Path, spec: dict) -> Path: + global _crop_dir + if _crop_dir is None: + _crop_dir = Path(tempfile.mkdtemp(prefix="glosso-store-crop-")) + # Key on the parent too: every locale has a file named today.png. + out = _crop_dir / f"{path.parent.name}__{spec['out']}__{path.name}" + if out.exists(): + return out + raw_w, raw_h = spec["raw"] + geom = f"{raw_w}x{raw_h - spec['crop_top'] - spec['crop_bottom']}+0+{spec['crop_top']}" + subprocess.run(["magick", str(path), "-crop", geom, "+repage", str(out)], check=True) + return out + + +def data_uri(path: Path) -> str: + return "data:image/png;base64," + base64.b64encode(path.read_bytes()).decode() + + +# The paths in the launcher foreground are authored in the owner's 501x418 logo +# box (the same numbers as docs/design/logo/glosso-logo.svg). The drawable then +# places and scales that box inside its 108-unit viewport. +LOGO_BOX_W, LOGO_BOX_H = 501.0, 418.0 + + +def logo_geometry() -> tuple[list[tuple[str, str]]]: + """The app's real symbol: each path of the launcher foreground and its colour. + + Reading the drawable (instead of re-drawing the logo) keeps the store assets + in step with the icon the app actually ships, colour included. + """ + xml = (REPO / "androidApp/src/main/res/drawable/ic_launcher_foreground.xml").read_text() + paths = re.findall(r']*?android:fillColor="([^"]+)"[^>]*?android:pathData="([^"]+)"', xml, re.S) + if len(paths) < 2: + raise RuntimeError("ic_launcher_foreground.xml no longer has two coloured paths") + return [(color, d) for color, d in paths] + + +def logo_group(x: float, y: float, width: float, geom: tuple) -> str: + """The symbol scaled to [width], top-left at (x, y).""" + scale = width / LOGO_BOX_W + paths = "".join( + f'' + for color, d in geom + ) + return f'{paths}' + + +def text_lines(lines: list[str], x: float, y: float, size: float, leading: float, + family: str, weight: int, fill: str, spacing: float = 0.0, + anchor: str = "start") -> str: + parts = [f''] + for i, line in enumerate(lines): + parts.append(f'{line}') + parts.append("") + return "".join(parts) + + +def phone_frame(x: float, y: float, content_w: float, raw: Path, clip_id: str, + aspect: float) -> tuple[str, float, float]: + """A hand-built phone mockup with [raw] clipped into it.""" + bezel = content_w * 0.024 + radius = content_w * 0.13 + content_h = content_w * aspect + body_w = content_w + 2 * bezel + body_h = content_h + 2 * bezel + svg = ( + f'' + f'' + f'' + "" + f'' + # A hairline over the screen edge reads as glass, not a flat sticker. + f'' + ) + return svg, body_w, body_h + + +def backdrop(w: int, h: int) -> str: + """Brand background: near-black ink with a cobalt bloom behind the device.""" + return ( + f'' + f'' + f'' + f"" + f'' + f'' + f'' + f'' + f"" + f'' + f'' + f'' + f"" + f"" + f'' + f'' + ) + + +def framed_screen(raw: Path, locale: str, screen: str, geom: tuple, fc: Path, + spec: dict) -> tuple[str, int, int]: + w, h = spec["canvas"] + gutter = w * spec["gutter_frac"] + max_text_w = w - 2 * gutter + headline, subline = HEADLINES[locale][screen] + + head_size = w * spec["head_frac"] + head_spacing = -head_size * 0.032 + lines = wrap(headline, head_size, 800, BY_FAMILY["display"], head_spacing, max_text_w, fc) + leading = head_size * 1.06 + head_h = leading * (len(lines) - 1) + head_size * 1.15 + sub_size = head_size * 0.42 + sub_h = sub_size * 1.3 + + img = cropped(raw, spec) + raw_w, raw_h = spec["raw"] + aspect = (raw_h - spec["crop_top"] - spec["crop_bottom"]) / raw_w + content_w = w * spec["content_frac"] + content_h = content_w * aspect + bezel = content_w * 0.024 + body_h = content_h + 2 * bezel + body_w = content_w + 2 * bezel + px = (w - body_w) / 2 + py = h - body_h - h * 0.024 + + # The wordmark is pinned top-left; the headline block is centred in the + # space left above the device, so screens with 2 or 3 lines look deliberate. + block_top = h * 0.104 + block_h = head_h + head_size * 0.4 + sub_h + start = block_top + max(0.0, (py - h * 0.02 - block_top - block_h) / 2) + head_y = start + head_size + sub_y = start + head_h + head_size * 0.4 + sub_size + + mark_w = head_size * 0.62 + mark = logo_group(gutter, h * 0.044, mark_w, geom) + wordmark = text_lines(["glosso"], gutter + mark_w * 1.38, h * 0.064, head_size * 0.54, 0, + BY_FAMILY["display"], 800, TEXT, -0.6) + head = text_lines(lines, gutter, head_y, head_size, leading, BY_FAMILY["display"], 800, TEXT, head_spacing) + sub = text_lines(wrap(subline, sub_size, 500, BY_FAMILY["ui"], 0, max_text_w, fc), + gutter, sub_y, sub_size, 0, BY_FAMILY["ui"], 500, MUTED, 0) + + frame, _, _ = phone_frame(px, py, content_w, img, f"clip-{locale}-{screen}", aspect) + svg = ( + f'' + + backdrop(w, h) + + f'' + + mark + wordmark + head + sub + frame + + "" + ) + return svg, w, h + + +def icon_svg(geom: tuple) -> str: + size = 512 + mark_w = size * 0.64 + x = (size - mark_w) / 2 + y = (size - mark_w * LOGO_BOX_H / LOGO_BOX_W) / 2 + return ( + f'' + f'' + + logo_group(x, y, mark_w, geom) + + "" + ) + + +def png32(path: Path) -> None: + """Re-encode as a 32-bit RGBA PNG, which is what the Play icon expects.""" + subprocess.run(["magick", str(path), "-alpha", "on", "-define", "png:color-type=6", str(path)], + check=True) + + +# The feature graphic's headline is the onboarding promise; only the subtitle is +# feature-specific. +FEATURE_SUBLINES = { + "en": "Pronunciation you can measure, sound by sound.", + "es": "Pronunciación que se mide, sonido a sonido.", + "fr": "Une prononciation qui se mesure, son par son.", + "de": "Aussprache, die sich messen lässt, Laut für Laut.", +} + +FEATURE_TEXT = {loc: (HEADLINES[loc]["onboarding"][0], sub) for loc, sub in FEATURE_SUBLINES.items()} + + +def feature_svg(raw: Path, locale: str, geom: tuple, fc: Path) -> str: + w, h = 1024, 500 + gut = 72 + text_w = 560.0 + headline, subline = FEATURE_TEXT[locale] + mark = logo_group(gut, 74, 38, geom) + wordmark = text_lines(["glosso"], gut + 52, 106, 34, 0, BY_FAMILY["display"], 800, TEXT, -0.5) + head = text_lines(wrap(headline, 50, 800, BY_FAMILY["display"], -1.6, text_w, fc), + gut, 226, 50, 55, BY_FAMILY["display"], 800, TEXT, -1.6) + sub = text_lines(wrap(subline, 25, 500, BY_FAMILY["ui"], 0, text_w, fc), + gut, 404, 25, 33, BY_FAMILY["ui"], 500, MUTED, 0) + phone = DEVICES["phone"] + img = cropped(raw, phone) + aspect = (phone["raw"][1] - phone["crop_top"] - phone["crop_bottom"]) / phone["raw"][0] + content_w = 210.0 + content_h = content_w * aspect + bezel = content_w * 0.024 + body_w = content_w + 2 * bezel + body_h = content_h + 2 * bezel + px = w - body_w - 70 + py = h - body_h - 20 + frame, _, _ = phone_frame(px, py, content_w, img, "clip-feature", aspect) + return ( + f'' + + backdrop(w, h) + + f'' + + mark + wordmark + head + sub + frame + + "" + ) + + +def main() -> None: + ap = argparse.ArgumentParser() + ap.add_argument("--locale", default="en,es,fr,de") + ap.add_argument("--only", default="phones,icon,feature,tablets") + args = ap.parse_args() + only = set(args.only.split(",")) + + geom = logo_geometry() + fc, _ = fontconfig() + + locales = [l.strip() for l in args.locale.split(",") if l.strip()] + + if "phones" in only: + for locale in locales: + spec = DEVICES["phone"] + for i, screen in enumerate(PHONES, start=1): + raw = RAW / locale / f"{screen}.png" + if not raw.exists(): + print(f" skip {locale}/{screen}: no raw") + continue + svg, w, h = framed_screen(raw, locale, screen, geom, fc, spec) + render(svg, OUT / f"screenshots/{spec['out']}/{locale}/{i:02d}_{screen}.png", w, h, fc) + + if "tablets" in only: + for device in ("tablet7", "tablet10"): + spec = DEVICES[device] + for locale in locales: + for i, screen in enumerate(TABLETS, start=1): + raw = RAW_TABLETS / device / locale / f"{screen}.png" + if not raw.exists(): + print(f" skip {device}/{locale}/{screen}: no raw") + continue + svg, w, h = framed_screen(raw, locale, screen, geom, fc, spec) + render(svg, OUT / f"screenshots/{spec['out']}/{locale}/{i:02d}_{screen}.png", w, h, fc) + + if "icon" in only: + icon = OUT / "icon-512.png" + render(icon_svg(geom), icon, 512, 512, fc) + png32(icon) + + if "feature" in only: + for locale in locales: + if locale not in FEATURE_TEXT: + print(f" skip feature/{locale}: no feature text") + continue + name = "feature-1024x500.png" if locale == "en" else f"feature-1024x500.{locale}.png" + shot = RAW / locale / "feedback.png" + if not shot.exists(): + print(f" skip feature/{locale}: no feedback raw") + continue + render(feature_svg(shot, locale, geom, fc), OUT / name, 1024, 500, fc) + + +if __name__ == "__main__": + main()