Closed GuyVervillePerso closed 3 years ago
Are you, perchance, using Craft? If so, it is a recurrence of #109.
No, I am using ProcessWire. I will try outside this CMS.
Guy Verville SPIRIA
De : Der Mundschenk & Compagnie @.> Envoyé : Saturday, April 17, 2021 4:54:40 AM À : mundschenk-at/php-typography @.> Cc : Guy Verville @.>; Author @.> Objet : Re: [mundschenk-at/php-typography] Space between every letter (#137)
Are you, perchance using Craft? If so, it is a recurrence of #109https://github.com/mundschenk-at/php-typography/issues/109.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mundschenk-at/php-typography/issues/137#issuecomment-821791872, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQTXETHUSKBKHWXYIWOV6SLTJFEFBANCNFSM43CAT2SQ.
No, I am using ProcessWire. I will try outside this CMS.
Thank you. The cause is very likely similar to the one in the referenced issue (a setlocale
call in an always-autoloaded boostrap file).
I will check that. BTW, there is a port for ProcessWire, but for the original PHP Typography which inspires yours, I think. The only problem with this module is that it is still not multi-lingual and in beta.
https://gitlab.com/rockettpw/tools/typographer https://processwire.com/talk/topic/15130-typographer/page/1/
@GuyVervilleSpiria Have you been able to investigate the issue or produce a minimal example for me to look at?
Hi, Sorry I didn't intervene earlier. The problem is probably similar to what I experienced with the module for ProcessWire. I just clarified a few things for the French.
/** @var \PHP_Typography\Settings $settings */
$settings = $event->return;
$lang = $event->user->language->name;
if ($lang === 'fr') {
$settings->set_hyphenation_language('fr');
$settings->set_french_punctuation_spacing(true);
}
});```
Hi, I do not understand why all the text is broken into one letter per word...
The code is a basic trial: ` $settings = new \PHP_Typography\Settings(); $settings->set_hyphenation( true ); if(user()->language->name == "fr"){ $settings->set_hyphenation_language( 'fr' ); $settings->set_french_punctuation_spacing( true ); }else{ $settings->set_hyphenation_language( 'en-US' ); } $typo = new \PHP_Typography\PHP_Typography(); $test = "Ange Michael is 27-28 years old and grows cocoa. His father died of malaria in 2009. The son had to take over the hectare of cocoa trees on his own to support the family. His mother works as a housekeeper, and, year in, year out, Ange Michael manages to provide them with the bare necessities. He does not live with them, however, and has his own house. He would like to get married, has a girlfriend who is still studying, but as long as he cannot live decently, he cannot get married."; $hyphenated_html = $typo->process( $test, $settings );
`