What are the correct AppBarButton icon sizes to include with UWP apps? - button

Note: This question is only about AppBarButton icons.
In writing a UWP app that runs on all form factors, I'd like to include all necessary variations of AppBarButton icons.
From what I've read so far, it seems that I need 24x24 icons in each of the five scale factors, 100%, 125%, 150%, 200%, and 400%. In other words, 24x24, 30x30, 36x36, 48x48, 96x96.
Is this correct?
Also, how should these be named so that the system correctly picks the right variant given the base name?
Edit: I've read elsewhere that only one size is needed, and that Windows UWP renders the icon in device-independent units (i.e. scales it appropriately.)
By comparison, iOS allows multiple images to be included with the #2x and #3x suffixes, and Android allows images to be placed in special subdirectories, e.g dir-hdpi, dir-mdpi, where dir is the base directory name. So it seems that UWP does not have such a system, and only a single icon is necessary. Is this revised understanding correct?

You are right: UWP apps render the size of the icon depending on the device. But you can use the icons using Segoe MDL2 in your appbar buttons. There are many icons prepared to be scaled automatically. I use this technique in all my UWP apps without problems.
https://msdn.microsoft.com/en-us/library/windows/apps/jj841126.aspx
If you are using a png image for your icon, I recommend you to set the size of this image to 48x48 pixels, which is the default size for appbar image icons. The UWP system will then automatically scale your icons without rendering problems.

Related

How can I compensate for fonts rendering differently on windows on a web page

I have a web page with text and an image. I want to place the text very precisely over the image.
I have discovered that with the font I am using, when viewing the page on windows, everything gets shifted down by about 4px. On Mac, iphone and android, it is placed correctly.
This does not happen if I use Courier New as the font, so I know that the problem is the font, however I have no choice but to use this font.
Is there a way to compensate for this purely in CSS, or do I need a javascript callback to detect windows and add a class so I can deal with it?
first of all, I would try tuning ling height, if that did not work, then I think you need to edit the font itself, you can do that using this site: https://transfonter.org/, uploading your font file and convert it to the formats you use and the important point is to check this toggle button, it adjusts some properties in the font so it has similar experience on different operating systems
if that did not work, there is a program called fontforge it gives you the ability to change font metrics, for more info you could check this question
Font Rendering / Line-Height Issue on Mac/PC (outside of element)

Whats the proper way for scaling text?

I am developing a Qt QML based application that runs on both Desktop and Mobile operating systems. I am having problems with proper fonts and components scaling- what does look good on large, desktop monitor is barely visible on a mobile phone, even though the scaling is the same.
I was wondering, what is the proper approach for this problem? I would like to run the same code on all platforms. For example, is there a way for a font to stay the same size (in mm or inches), no matter the screen resolution and size?
In QML I am always setting the font.pointSize property. It is scaled evenly, but because of that, the font are barely visible on mobile devices.
Have you tried font.pixelSize property yet?
I think this will be good for you.
"Sets the font size in pixels.
Using this function makes the font device dependent. Use pointSize to set the size of the font in a device independent manner."
https://doc.qt.io/qt-5/qml-qtquick-text.html#font.pixelSize-prop

Using the same font size or width px in Wicked pdf shows differently in MAC and Ubuntu

I use wicked pdf for generating pdf in my ruby on rails project. I set CSS in the part in show.pdf.erb.
I use the same font-size px for p or same width or height px, however, in Ubuntu system it's much bigger than in the Mac system. I set the same page_size: 'Letter', may I know how to solve this? Is that because of the resolution or retina of Mac? Even if I use em or % for the font size or width, it still looks very different in Mac and Ubuntu. I want to make a business card size div with some content inside no matter people use Mac to open and print the pdf or Ubuntu.
Wickedpdf on different platforms renders differently because of:
system fonts are different (this can be somewhat fixed by using custom web fonts)
systems have different DPI settings (this affects sizing the most, but can be tuned)
different font renderers and smoothing
For exact sizes it's better to use corresponding markup - with cm or in units.
Also for more control over resulting pdf - you may want to eliminate intermediate html render and use direct pdf rendering with something like prawn pdf

Meteor mobile-config.js launchScreens

I'm creating the splash images for my app but I've got some questions:
Can I create of all them at once? I've seen some repos for this but
there are not updated with new sizes (e.g 2048x1536)
Would be possible to use the same image for different sizes?
My phone is 1920x1080 but there is no splash screen size for that so it takes one and applies a disproportionate image. If I've got
text on it it looks really badly.
What happens with the rest of images when I build? Meteor removes the rest? Are located in resources/splash.
Could be possible to use a html with css page?
Thanks in advance!
Next time you should consider splitting your questions into independent posts.
Creating splash images: if your image is simple enough, indeed you have many scripts that can generate the different sizes automatically. I am sure you can customize them to fit your sizes.
Use the same image for different sizes: in general, that would mean your image will be stretched by the device to fill the screen. On Android, you can define a 9-patch PNG that will tell the device which pixels can be stretched, so that some part(s) of your image is not deformed.
Deformed image for 1920x1080 screen: depending on the pixel density, there should very probably be a placeholder for that.
Storage of image versions: by default, all versions (i.e. sizes) are packaged within your APK / APP, so that whatever the device needs will be available once user has downloaded the app.
Using an HTML+CSS page for splash screen: in general, no, but it depends on what you want to do with your splash screen. Meteor calls it "launch screen", because it is the first thing it displays while the app is loading / "launching". In particular, the WebView and local server may not be ready yet, and cannot serve any HTML/CSS. That is why you have to use a plain image, which is passed to a very simple activity while the app is loading. But some people also use a "waiting screen" between some parts of their app. In that case, your WebView and local server are already loaded, and you can simply use whatever you want.
Update:
For Android, if 9-patch PNG does not fit your need, you can also try to request Cordova's splashscreen plugin to maintain the aspect ratio of your image:
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/#preferences
<preference name="SplashMaintainAspectRatio" value="true" />
"SplashMaintainAspectRatio" preference is optional. If set to true, splash screen drawable is not stretched to fit screen, but instead simply "covers" the screen, like CSS "background-size:cover". This is very useful when splash screen images cannot be distorted in any way, for example when they contain scenery or text. This setting works best with images that have large margins (safe areas) that can be safely cropped on screens with different aspect ratios.
In Meteor, you would use App.setPreference in mobile-config.js:
App.setPreference("SplashMaintainAspectRatio", true, "android");

How can I use multiple icon size in same wizard?

How can I use multiple icon size in same wizard?
I have 16x16, 32x32, 48x48, 64x64 and 256x256 icon's size and I want to know if i can use them all in nsis?
To use as small, medium and large icons. If I change the view in windows explorer the icon of my setup becomes distorted.
A Windows icon can contain multiple images with different sizes, your icon should ideally contain 16x16, 24x24, 32x32, 48x48, 128x128 and 256x256 pixel images.
You need to use a icon editor to create the .ico. There are multiple free icon editors and converters out there...

Resources