Is there a way to show text outline on a TextBlock? I am showing some text on top of map control and would like to show the text in black with white outline so it's always readable. Something like this:
Thanks for any tips
This sort of font manipulation isn't supported in Windows.UI.Xaml, but you can interop to DirectWrite to draw text with effects into a bitmap and then composite the bitmap on top of your map.
For static text you can either pre-create a bitmap or convert the font to paths as Chris W says. The Windows.UI.Xaml.Shapes.Path's Data is essentially the same as SVG's, so you can use many vector graphics programs for the converstion by saving to SVG and then copying the path data from SVG Path's d= attribute to Xaml Path's Data= attribute.
Drop shadows aren't supported in Windows.UI.Xaml without interop to Direct2D, so the fake it link won't give any advantage over DirectWrite in this environment.
The simplest way to ensure contrast would be to place the text on a partially transparent box, but that will give a different look.
Related
I have a large image, based on a vector drawable xml file, and I would like to visualize only part of it in an ImageView, like this (the darker regions would be off screen):
Under user control, the image would move around (or rather, the visible part of it), very much like a Google maps app.
I can manage to dig into Android Studio but I would like to get some hint on what would be a proper approach to handle this. Is using a large xml file and clipping it appropriate or is it better drawing it on a canvas in runtime?
I played with both vector drawables and drawing on a canvas, but not enough to be sure which way to go for this or to post any code.
Is it possible to invert the colors within a box (4 sets of coordinates) on a page from within the page's content object code?
My pages consist of simple B&W JBIG2 images and I wish to make the white black and the black white within a small box to highlight something.
As mkl suggests, you may extract the images and change their bits - this might prove to be a little bit of work however. There might be another useful approach here, specifically useful because it would work regardless of what the underlying objects are.
It is possible in PDF to add a transparent object (for example a rectangle) over all underlying objects. In your case you would create a rectangle that you put on top of the images you already have in the page stream.
If you paint this rectangle in white, set it to transparent and choose "Difference" as the transparency blending mode, the net effect should be that the colors underneath your rectangle are inverted.
From the PDF specification: "Painting with white inverts the backdrop colour; painting with black produces no change."
This may be the quickest and most painless way to accomplish what you are looking for...
Can't figure out how do I prepare the images for the Iconic tile on WP8. The guide is here. My tile is very simple - no counter, no variable text. Just the image and the app title.
So I should provide two image files - IconImage and SmallIconImage (the XML elements in the manifest are called differently, by the way). But which size should I make them? The guide says the tile is 159x159 and 336x336, respectively; but the icon within the tile is 110x110 and 202x202. The rest is text and counter, as overlaid by the Windows Phone shell.
Which size should I use for my two images? Should I just draw the icon, or a larger image some blank space and the icon in the required boundaries?
EDIT: relevant discussion here.
The correct size would be:
Small: 72×110
Medium: 132×202
You can find more details here http://mikaelkoskinen.net/windows-phone-8-iconic-tile-image-size-comparison
The guide is showing that you make your icon 110x110 and 202x202. The 159x159 and 336x336 shown in the guide are noted for the size of the tile. If you want to use the Iconic Template, you do not create the entire tile like you used to. Instead you designate the icon to be used within the tile. Search for "icon" within this link. http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8
I am trying to convert a pdf into tif using ghost script. Is it possible to remove the background (grey color) of a text block (back font color) in a pdf using ghost script? I would like to replace the grey background to white.
Appreciate your help!!
I don't think you'll get a generic solution to your problem because there are many different ways such a background may be coded in your PDF and there is no sure way to distinguish such a background from a rectangular form of some vector image.
PDF essentially offers a set of tools for positioning glyphs and vector graphics in some rectangle (page) to display and some additional tools to add some interactivity (e.g. forms). Thus, a colored background in a PDF generally is created by drawing a line along the edge of the area of the background, fill this form with the desired color, and position glyphs and graphics (text and images) atop it. There are other operators, too, which can be used, though, and many variants of their use, and generally the form created is not marked as background.
In the answer Dingo refers to in his comment a rectangle covering the whole page, actually even a bit more (in case of a fairly common choice of a media box), is drawn (m: move to a corner; 4*l: draw the 4 edge lines; h: close the path; f fill the form).
Thus, please make the PDF in question available for inspection, maybe there is some specific solution for your file.
Right now, I have a couple fonts: HoboStd20.fnt which points to HoboStd20.png and Teen40.fnt which points to Teen40.png
However, I need retina display fonts.
How do I go about inserting these bitmap fonts into the app?
Do I need to create a font that is twice the size of the original fonts?
How should I name the fonts? Do I rename both the png and fnt file like this: HoboStd20-hd.fnt?
Thank you!
The basic routine is to design your bitmap font at either SD or HD resolution. Then re-export the same font with double or half the font size.
For example, when I design fonts using Glyph Designer (highly recommended), I first create the Retina font and save it as font-hd.fnt. Let's say this has a font size of 40 points. Next I set the font size to 20, and re-export the file as font.fnt.
In cocos2d you reference only the font.fnt file. It will automatically load the font-hd.fnt file on Retina devices.
Sounds like you're using Angelcode's BMFont to generate the fonts (are you?).
Are you using alpha-tested edges for these fonts or using a distance-field based rendering scheme?
This paper called "Alpha-Tested Magnification for Vector Textures and Special Effects" might help you get acceptable quality without having to double the size of the font/texture.
That said, if you are using BMFont (and can write shaders to unpack pixel data) - it is also possible to pack multiple pages using one bit per page or one channel per page. This + alpha tested + distance field should give you pixel-perfect quality for text.