Burmese Character as a string
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I am trying to obtain the string representation of the burmese character given by the unicode number U+103A. But it does not print out, and only gives a box in the figure and the command window, even after using UTF8 as the character set. This unicode number is the exact figure of dotted circle with a solid semi-circle on top of the dotted circle.
How can I save this character as a string? Thanks.
p.s. - I am using other unicodes (in the same dot-m file) which require utf8 as the default character encoding. These ones require a non-English language, which is also the one set in the system Language Preferences. But this is not the Burmese language.
် this is the character.
3 commentaires
Réponse acceptée
Walter Roberson
le 9 Nov 2020
Modifié(e) : Walter Roberson
le 9 Nov 2020
So I did some testing... but you will need to do the same tests on your own system to see how it goes.
The characters show up as combined (when the combining character is put after the base character) on the command window when LiveScript is used.
The characters do not show up as other than boxes in the test I did here online, on the experimental facility to display results for you, but when I test on my Mac, the characters show up separately for all fonts except a few of the Lucida fonts (and then they show up as boxes.) I was not able to get the characters to combine on a plot... except by drawing multiple characters at the same position (but then they will not combine properly as the dotted circle will show up, which should not happen when a real combination is done.)
Please test this code on your own system, inside of and outside of Live Script.
B103A = char(0x103A);
B1004 = char(0x1004);
B103A
B1004
S1 = [B103A B1004] %this does not combine, so this is not the proper order
S2 = [B1004 B103A] %this combines, so this is the proper order
%When I use Livescript, S2 displays in combined form to the command window
%But when I use Mac command window, S2 displays separately.
%I do not have a Windows system handy
%now try plotting with all kinds of fonts
%sorry for all the figures, but this system only displays up to about Ylim 16
FL = setdiff(listfonts(), 'Symbol');
NF = length(FL);
for fidx = 1 : 15 : NF
tF = FL(fidx:min(NF,fidx+14));
fig = figure();
ax = axes('Parent', fig);
for K = 1 : length(tF);
fn = tF{K};
text(1, K, fn + " -> " + S2, 'fontname', fn, 'interpreter', 'tex');
end;
xlim([0 75]); ylim([0 16]);
end
6 commentaires
Walter Roberson
le 11 Nov 2020
It is disappointing that the controls never seem to render the characters properly at all, and that text() is not able to render the combining codes properly.
The one positive result of this is that it shows that if you are getting just plain emptiness instead of the characters, that changing the font can help to at least get a placeholder.
Note: the 15 fonts per plot was chosen to fit in to the experimental facility I am using to show the results online, which unfortunately does not display large plots without clipping.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!