How to display special symbols in Gtk.Label? - unicode

I am writing an Instagram client for Ubuntu in Vala. And I'm using Gtk.Labels to display post title, comments etc. Problem is, sometimes received data contains special symbols like smiles etc. And currently they are displayed incorrectly, like in the picture (these squares containing 6 hex numbers):
I guess that's not the problem of my application because I've seen such behavior in other apps (for example, Pantheon Files). But anyway, this is not the way I want my program to behave, I want these symbols to be displayed correctly.
So, my question is: is it possible to achieve the behavior I want? And if it is possible, then how?

There was indeed an issue with the font I'm using. I just installed ttf-ancient-fonts package (according to the https://www.kirsle.net/blog/entry/make-emoji-work-in-linux) and now it is working.

Related

AppJS does not show Unicode characters

I have a situation where I want to open a website by clicking a desktop icon. I found AppJS to be the answer. I created an app with just a full window covering iframe. The only problem I am facing is, Unicode characters are not shown properly (all I see is boxes in place of text). I could not understand where should I look for. Please, give me some pointers. or maybe an alternative to fulfill the original purpose.
Thanks in advance

How can I auto-modify an image?

The question I am asking is a little bit abstract, so I will try to make it more clear. There are websites where you sign up and get a signature in the format of an image. It has a general format, say a few boxes that are empty, and a logo in the middle. Now, say you gain the "Overachiever" badge, which looks like a pen. You signature is then updated, automatically, to include that pen badge in one of the blank boxes. I am completely clueless as to how to do this, and in what language to do this is, so can anyone help? I have been thinking about PHP as an option, but I do not know if that would work. Any suggestions?
You can do this with PHP (imagecreate) and for the updates in your images you can use cronjobs.
Is this for a forum? Depending on the platform, I know some hosts already have "addon's" that provide similar functionality to what you're after. (Karma addons etc.)
Maybe one of these will help? phpBB has some stuff like that.
https://www.phpbb.com/community/viewtopic.php?t=2147118
http://www.concrete5.org/
If you can execute an external process, you can do this using Image Magick.

iPhone - UITextView with html content?

The UITextView has a method named setContentToHTMLString that displays html inside a UITextView.
But this is a private API and probably gets my app rejected by apple.
Is there any way around this to somehow set the content to an htm string without calling this method directly? or any other way to allow html content in a view that is editable (Keyboard accessible)?
I absolutely loath the Three20 framework. It adds huge bulk to your apps, adds a ton of class categories that you probably don't need, multiplies your compiling time many times on a clean compile, and can cause issues if you accidentally don't set all of the sub-projects settings correctly -- personal horror story, I had an app update in the app store broken on all arm6 devices for 3 weeks after adding Three20 while Apple took their sweet time approving my simple fix.
Anyway, enough bashing on Three20. Here's another option if you want something much more compact that is a simple drop in replacement for UITextView with basic HTML support: http://www.cocoacontrols.com/platforms/ios/controls/bctextview. I don't know if that one supports editing though. This one: http://www.cocoacontrols.com/platforms/ios/controls/egotextview supports rich text editing, but I'm not sure if it's in HTML format. They're both worth a look though to see if you can utilize them for your needs. I would only use Three20 as an absolute last resort, and then still probably wouldn't use it.
The closest thing I know to what you are asking are TTStyledText and TTStyledTextLabel, two classes from the Three20 framework that allows you to treat HTML content. They only support a limited subset of HTML, though, so I don't know if this fit your needs.
If you simply want to display/edit some unformatted text taken from the web, have a look at: +stringWithContentsOfURL:encoding:error:
[UITextView setValue:textString forKey:#"contentToHTMLString"];

Porting Max/MSP .app to iOS

I've read a number of posts on Apple's forums, and a number of posts on the Cycling '74 forums (with my own questions scattered around both) and nobody seems to be able to help me.
I used Max/MSP to write a 'patch' that takes samples and generates music. I'm going to release it as an album similar to Brian Eno's Thursday Afternoon, but wanted to make it available to people so they can have the music last for more than the hour a CD can hold.
What I don't know how to do, and can't figure out is HOW. It looks just like a regular OS X app, and the only difference I see in the directory structure is that my Max/MSP made application has extra .framework folders as well as the objects I use (which I guess are similar to 'functions' in JScript). I've looked at the package contents of both OS X files and the unpacked .ipa files from the App Store. Being so similar I would imagine it'd be pretty easy.
Where do I start? Has anybody on this forum done this? Thanks for your time!
[edit] - I just wanted to let you know I've discovered RJDJ, an iOS app that allows users to create 'scenes' in Puredata (Pd) and load them on their RJDJ program. I'd rather not go this route.
[edit2] - ok. I agree that it's very different. Especially having 4 (i could cut it down to 3) additional frameworks that aren't part of the SDK. But Ive been thinking. I can add a JavaScript object inside of my program, or make a special new object (object in max is sort of like a class in JS, i think) using C. Is there anything in these languages that would be able to convert a simple 'touch' to a 'mouseclick' in my app?
My application is very very simple. Basically just samples, played at randomly generated time intervals with some a 'conductor' to bring in/out the groups the samples are drawn from (piano, fx, etc...). So the user just clicks the 'start' button and off it goes. So the .nib file I would need to create is very simple. In my head it seems like the .ipa package/ios .app both contain unix executables and so long as these are basically the same it should work, right?
Max6 has been released.
A new object/concept named gen~ is available.
As far as I discussed with C74 dev, I know gen~ WILL provide its source code output. This code produce by the gen~ object could be useable in any other framework. basically, it will be C++
So it would really open A LOT of possibilities ; Max becoming a real graphical framework producing output that can be used in programming world.
It would save time for some part of the code.
As far as I can see from poking around at the Cycling '74 site and forums, there's currently no Max engine available for iOS. libpd is probably your best bet, really. (I'd note that the Inception app uses this Pure Data engine with a custom interface and it works very well.)
Unfortunately OSX and iOS apps are completely different under the hood. Outwardly they look similar (eg. you've noted the .app extension) but the internals are completely different.

How to combine a number of screens into a single display in gtk

I have a problem where i am supposed to export the display to many other screens where those screens form a part of a single display( ie many screens combine to make a single display). I know i have to use GdkScreen for it but i still dont kno how to. Can anyone please give me an example or an explanation or guide me to a related tutorial for it? How do i export the display to other systems?
If I understand the question, this isn't something GTK would do, it's something you would configure when setting up the X server. The feature is called Xinerama (among other names).
Look for stuff under preferences called Monitors or Display or things like that. It depends on your Linux distribution and video drivers.