Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Wikipedia:Reference desk/Archives/Computing/2026 July 2

From Wikipedia, the free encyclopedia
Computing desk
< July 1 << Jun | July | Aug >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 2

[edit]

Handling decimal separators in SVG for different languages

[edit]

This thread makes me wonder if there's a standard (or clever) way to automatically handle decimals in multilingual SVG or rsvg. For example, showing "1.234" in English and "1,234" in German.

I'm aware that the usual way to translate strings is with switch and systemLanguage. However, it is tedious and prone to error. Moreover, if a number needs updating, editors have to ensure that every instance is updated.

Is there a way to define text strings analogous to

<defs>
 <switch>
  <string id="decimal" systemLanguage="de,fr,es,it">,</string>
  <string id="decimal" systemLanguage="ar">٫</string>‎
  <string id="decimal">.</string>
 </switch>
</defs>
<text>1<use href="#decimal"/>234</text>

?

Thanks, cmɢʟee τaʟκ (please add {{ping|cmglee}} to your reply) 10:49, 2 July 2026 (UTC)reply

It is very clunky, but you can use text spans for it:
<text>
1
<switch>
<tspan systemLanguage="en">.</tspan>
<tspan systemLanguage="de">,</tspan>
<tspan>.</tspan>
</switch>
234
</text>
Most renderers should obey the switch. An old (or just badly coded one) will display 1.,.234. ~2026-35239-54 (talk) 13:33, 2 July 2026 (UTC)reply
Thanks, though it looks even more tedious and error-prone. Any other way? cmɢʟee τaʟκ (please add {{ping|cmglee}} to your reply) 22:57, 2 July 2026 (UTC)reply
its also possible to simply use a (non-breaking) space instead, such as 1 234. That way, the confusion between systems regarding thousands is largely removed. I tend not to use three decimal places for this reason and not bother with the comma for four digit numbers. Its why I see the decimal comma being used on nutrition information products in the UK imported from the EU, such as 3,5g. JuniperChill (talk) 08:46, 4 July 2026 (UTC)reply
@JuniperChill: thanks, though I was meaning the decimal "point", not digit grouping separator. cmɢʟee τaʟκ (please add {{ping|cmglee}} to your reply) 20:02, 4 July 2026 (UTC)reply

Faithful rendering of bitmap in Word

[edit]

Hello, does anyone know of a way to include a bitmap image (e.g. pixel art) in a Word document so that pixels remain sharp squares and are not smoothed or blurred? For example, I have a 20x20 bitmap image and I want to make it full page and keep all the pixels square and sharp. There are some discussions online that I have found, but they all suggest methods that do not actually work, or the responders fail to understand the question. Yes, I am aware that the bitmap could potentially be resized to 1000x1000, or whatever, in another application; what I am asking is whether there is any setting in Word itself that achieves what I want. I haven't found one so far. Thanks. ~2026-37847-80 (talk) 20:35, 2 July 2026 (UTC)reply

I am by no means an expert on this subject, but given all the difficulties one is likely to run into, I would seriously consider creating a (say) 500x500 pixel image, with each pixel in your original represented by a monochromatic 25x25 px square. That way, when Word (or a web browser, or a PDF viewer, or whatever comes into play down the line) insists on resizing your image, you'll still get (i.e. the end user will see) something like what you want. —scs (talk) 22:01, 2 July 2026 (UTC)reply
I doubt this is possible in Word; it's just not that sophisticated an image tool. One option might be to create a table and colour each cell as required. This could also be pasted in from Excel if that's easier. Matt Deres (talk) 12:41, 3 July 2026 (UTC)reply
In this instance I'd say the opposite: it's too sophisticated for what I want, anti-aliasing bitmap images that would be simpler to leave alone, and apparently no way to switch this off. ~2026-37847-80 (talk) 21:23, 3 July 2026 (UTC)reply
Phrase it however you like, but unless you restrict people with very stringent rules about what size/ratio they can change their images, bitmaps have to be aliased in some way during resize. You're perceiving it as a silly hindrance now because you happen to want to multiply the size out perfectly, but the users who want to make their 20x20 image into 25x25 or 30x30 or whatever and can only do that if the program allows aliasing would not. Of course, if you want to avoid aliasing, you could make it into a vector graphic, though that comes with annoyances of its own. Matt Deres (talk) 01:31, 4 July 2026 (UTC)reply
I don't have access to Word, but using LibreOffice Writer, which has very similar functionality, an inserted bitmap has handles along its edges when selected, which allow the user to resize it into a page-filling image in which each original pixel becomes a strictly monochromatic rectangle.  ‑‑Lambiam 06:14, 4 July 2026 (UTC)reply