EMOJIS AND MULTIPLE LANGUAGES AT ONCE

285 views
Skip to first unread message

purushottam yadav

unread,
Oct 5, 2021, 4:53:15 AM10/5/21
to Kivy users support
I want to emiojis option in keyboard in  my android app and multiple languages too .   I dont have any knowledge about how to implement  this  , if any one have knowledge about emojis and  multiple languages , please share , if any  project you know ,please share it  here .  Thanks in advance .

Elliot Garbus

unread,
Oct 5, 2021, 11:08:44 PM10/5/21
to kivy-...@googlegroups.com

To display emojis, select a font that includes emojis, and use literals for the Emoji.  I have attached a small example that puts and emoji in a label.  When you say multiple languages are once, I am assuming you want to support the user selecting a language.  This is referred to as internationalization often abbreviated as i18n.  There are a number of frameworks for internationalization.  In the standard library see: https://docs.python.org/3/library/i18n.html

 

from kivy.app import App
from kivy.lang import Builder

kv =
"""
BoxLayout:
    Label:
        text: 'Test Emoji:' + '
\N{grinning face}'
        font_name: 'seguiemj'
        font_size: 40
"""


class EmojiApp(App):
   
def build(self):
       
return Builder.load_string(kv)


EmojiApp().run()

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/88f5cfe8-842e-4d2e-bc16-92d3f3421a12n%40googlegroups.com.

 

purushottam yadav

unread,
Oct 8, 2021, 1:41:02 PM10/8/21
to Kivy users support

I am getting below error while running your code in ubuntu . where can i get    File 'seguiemj.ttf'    ? 

  I  am saying at  about Including emojis  and multiple languages in  a TextInput    . I see no emojis option in keyboard to use emojis in Label , and same with languages, I use  google indic keyboard for  typing  other  INDIAN languaes  in whatsapp , instagram  , but it is not showing up in kivy android app while using textinput  .  




 Traceback (most recent call last):
   File "main.py", line 18, in <module>
     EmojiApp().run()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/app.py", line 950, in run
     runTouchApp()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/base.py", line 582, in runTouchApp
     EventLoop.mainloop()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/base.py", line 347, in mainloop
     self.idle()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/base.py", line 387, in idle
     Clock.tick()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/clock.py", line 733, in tick
     self.post_idle(ts, self.idle())
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/clock.py", line 776, in post_idle
     self._process_events()
   File "kivy/_clock.pyx", line 616, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
   File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/uix/label.py", line 413, in texture_update
     self._label.refresh()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/core/text/__init__.py", line 759, in refresh
     self.resolve_font_name()
   File "/home/purushottam2/Desktop/project/tttt/lib/python3.7/site-packages/kivy/core/text/__init__.py", line 356, in resolve_font_name
     raise IOError('Label: File %r not found' % fontname)
 OSError: Label: File 'seguiemj.ttf' not found

Elliot Garbus

unread,
Oct 8, 2021, 4:19:33 PM10/8/21
to kivy-...@googlegroups.com

'seguiemj.ttf'   is a font that is bundled with Windows. You will need to find the font for your platform.

 

I found these with a quick search: https://www.joypixels.com/fonts

There might be other emoji font for Android, or bundled with Android.  https://developer.android.com/guide/topics/ui/look-and-feel/emoji2

 

I have not done any Android programming. 

purushottam yadav

unread,
Oct 9, 2021, 12:49:52 PM10/9/21
to Kivy users support
I am  asking in case of android , DO you have any information about my initial question  ROBERT, you work on android apps , right ?
below is my intial question .


  I  am saying at  about Including emojis  and multiple languages in  a TextInput    . I see no emojis option in keyboard to use emojis in Label , and same with languages, I use  google indic keyboard for  typing  other  INDIAN languaes  in whatsapp , instagram  , but it is not showing up in kivy android app while using textinput  .  

Robert

unread,
Oct 9, 2021, 4:10:40 PM10/9/21
to Kivy users support
I think Elliot's answer is absolutely correct, the app is written to depend on a specific font.

Not all OS include the required font, so the app as built is not portable. Which is what you see.

You do see the font in other apps, perhaps means that the font was included in their build?

Depending on how the font you find is packaged, include it either with 'requirements' or 'source.include_exts'.
I do not have an example. But a quick search will find examples such as
Reply all
Reply to author
Forward
0 new messages