Custom ttf fonts in SpriteBuilder/Cocos2d-iPhone 3 - cocos2d-iphone

Did anyone get custom ttf fonts in SpriteBuilder/Cocos2d-iPhone 3 working?
Ie: For a CCLabelTTF in SpriteBuilder, we can select a ttf file added to the SP project. However after publishing, the font does not display. Do we need to add the font in Info.plist etc as well? I tried it, but couldn't get it working. I tried some different path attempts but couldn't get it working.
For now I do it the old Cocos2d-iPhone 2 way; add the fonts to the xcode project, add the filename to the font settings in Info.plist... then just change it manually per CCLabelTTF. I don't think the SpriteBuilder fonts work yet seeing as you only specify a TTF file for a CCLabelTTF - a ttf file could contain many different fonts (or as far as I remember)

In info.plist, under "Fonts provided by application", add a new row, and insert the font name including extension.

Hmm. I haven't had to do anything with the plist; everything just's magically worked. The only place where not is when I want to set a font in code...and then I have to pass a long path to the font. And I'm sure the fonts aren't available to non-cocos UI elements, but I don't have any of those....

Related

SWIFTUI - Catalyst app - How to set Document Types to show icon for file

I use Xcode 11.4.1 and I want to show GeoIcon.icns icon for the file, with extension .geo, create with my simply app: OpenSave.
I have set Document Types and Exported UTIs as shown in the following screenshot.
The Info.plist file, deriving from the above settings, is the one shown in the screenshot below.
The result of the above settings is illustrated in the screen shown below.
Why do the files created by the Opensave app have the app's shrunken icon and not the one I set? What am I wrong in the Document Types and in the Exported UTIs setting?
I searched the web for several days, without finding any posts that would solve my problem.
I think the problem is that you use .icns as file type for the icons.
Have you tried a .png icon as well?
This should resolve your issue!

Unplated icon for MSIX-packed Win32-application doesn't work

I am trying to generate a MSIX-installer for a Win32-OpenGL-application, which is supposed to be deployed in Microsoft Store. Therefore, I have first built the .exe-file in Visual Studio and packed it with MSIX Packaging Tool to a .msix-installer. After that, I edited the .msix-package and added the required images (Square44x44Logo.png, Square71x71Logo.png,...). Unfortunately, I found out that the icon in the task bar was plated. I tried to add another image (Square44x44Logo.targetsize-44_altform-unplated.png) to the .msix-package by editing it again with the MSIX Packaging Tool, but the task bar icon remained plated. How can I change my task bar icon to unplated?
Unplated assets
By default, Windows uses a target-based asset on top of a colored
backplate by default. If you want, you can provide a target-based
unplated asset. "Unplated" means the asset will be displayed on a
transparent background. Keep in mind that these assets will appear
over a variety of background colors.
Unplated assets and themes
The user's selected theme determines the color of the taskbar. If the
unplated asset isn't specifically qualified for the current theme, the
system checks the asset for contrast. If it has enough contrast with
taskbar, the system uses it. Otherwise, the system looks for a
high-contrast version of the asset. If it can't find one, the system
draws the plated form of the asset instead.
Follow the steps below to solve this problem:
Obtain the correct 44x44 images and then copy them into the folder
that contains your images (i.e., Assets).
For each 44x44 image, create a copy in the same folder and append
.targetsize-44_altform-unplated to the file name. You should have two
copies of each icon, each named in a specific way. For example, after
completing the process, your assets folder might contain
MYAPP_44x44.png and MYAPP_44x44.targetsize-44_altform-unplated.png.
In the manifest file, set the BackgroundColor for every icon you are
making transparent.
Continue to the next subsection to generate a new Package Resource
Index file.
For more details, refer: Add Target-based unplated assets
Here is a similar case for your reference.
unplated taskbar icons in Desktop Bridge apps

How to Specify fonts for Text fields using muPDF

I am using muPDF library to add fields in existing PDF Documents.
I have successfully added a checkbox by defining its appearance.
But Text Fields are a problem as they need a Font Resource.
I cant figure out how to add fonts in a PDF document.
muPDF does have functions that deal with fonts, but I am unable to use them in a proper manner.
So i need to know how to load a font in a PDF document and how to reference them to my Text Field in the default appearance(DA).
----------------------------------------------------------EDIT------------------------------------------------------------------
Currently I am using the function pdf_set_free_text_details in pdf-annot-edit.c
But it only sets the predefined fonts . i wish to use other fonts as well
If this is not the right place to ask this question, then please if somebody could redirect me to the correct place. MuPDF only has a bug report site as far as i know.
Pass any of the font types specified on pdf-font.c as a string.
For eg: "Courier", "CourierNew", etc..

Changing the Django-CMS default icon for links

The contents of placeholders in Django-CMS can be modified with the provided frontend editor, which includes a basic plugin for inserting links. By default, this plugin shows a square "blue globe" icon in the editor preview where the link will appear. I'd like to change what icon appears, preferably to a text representation of the link rendered as an image. Is it possible to modify the existing link plugin, or would I have to make a new plugin with this behavior?
You'll need to build your own link plugin for that which defines the icon_src method which has to return a URL to a image.

How do I get a folder displayed in TreeView Qt

I have a TreeView in a QtGui. But I want it to display only one folder at 'F:\Qt\GUI\files'
I have tries a tutorial on youtube (http://www.youtube.com/watch?v=M0PZDrDwdHM) but I read on qt-project.org that QDirModel is obselete now. And I don't know how to do this now. The end result needs to be the same as in the youtube video but than without all the other drives and folders on the pc.
Thank you so much! :)
You just need to use QFileSystemModel instead of QDirModel. To set directory you want to be displayed use the setRootPath method. For example, to display MyComputer content use an empty string as a parameter value.