Rendering barcodes in HTML with Code 128 font - html

Is it possible to render correct bar-codes in HTML using the Code 128 font?
The main content of the bar-code is fine in the broswer (firefox) but when I try to add the start code character I just get this character in the browser:
Ñ
This is ASCII code 209. I'm wondering if it even has a bar representation.
I'm using MVC but this is really just a HTML/CSS problem I think.
Thanks

This isn't quite what you asked for, but you can make barcodes using CSS: see http://unixshell.jcomeau.com/src/barcodes/memberships.html. I'm using code39 for this, but most other linear codes can be done the same way.

Are you sure that the client is going to have barcode font installed?
Server side image generation seems to be a better solution.
You may want to try Barcode.dll for barcode rendering.
It includes ASP.NET barcode control - just drag & drop.
Please note that this is a commercial product I developed.

I know this is years too late, but looking again at the question, I'm pretty sure you're just not using the right numeric code for your font. there is no single "Code 128 font". while 209 is shown by Wikipedia to be the correct "common" code for Start B, in various fonts I found online this is not the case. in this, Start B is 236; and here it's 204. use the right code for your particular font, and you should get what you want.
a code point not encoded by the barcode font will be rendered by a default font, which is why you're seeting the N tilde character.

Related

Embed a symbol from a custom font

maybe this question is too easy, but I couldn´t find anything helpful.
I know how to define a custom font in a CSS file by #font-face.
What I don´t know is how I can find out which code I have to use to display a certain symbol.
To make my request clearer I can give you a simple example:
How can I display the second snoopy icon from this font on a webpage?
http://de.fontriver.com/font/snoopy_dings/
And how do you find out the code for a certain symbol?
Thank you for your efforts,
Robert
First of all you need to find out the relevant letter that maps to your symbol. for that download that font and install it to your computer, open up a word processor and use insert symbol feature. So you can find the relevant English letter. Lets say it is "L".
Then you just type L in HTML and set the font through CSS.
for your problem, it is "B" so to display the second snoopy icon from this font on a web page you need code below.
HTML
<span class="snoopy">B</span>
CSS
.snoopy{
font-family: "Snoopy Dings";
}
I guess your symbol is a letter, but the font is so weird that it doesn't look like a letter. Use you font and try to write the B letter. It should be your Snoopy icon.
Unless you have a alphabetic chart there's no easy way to find out what icon is linked to what other letter. The easiest solution is to just type out the letters in that font and see what pops up.
There's actually an option in the site to try each letter (under Probefahrt). That gives you an input in a normal font and outcome in the custom font.

searching for a reply utf character arrow that works accross browsers

I am currently using the utf code "\293B" for an arrow to put before the reply link in posts. the html is declared utf 8. The arrow works in firefox and explorer but not chrome. i saw that wordpress uses content: "" ("\f412";) (for example here:http://cinematicamsterdam.wordpress.com/2014/05/26/cinematic-city-a-retrospect/) that works accross all browsers but I can't paste it in my document. How can I do it?
i'm a newbie here, sorry if the question is simple..
This does not primarily depend on browsers but on fonts installed in the system; secondarily it depends on your CSS settings and on some shortcomings in browsers. For a general description of such issues, see my Guide to using special characters in HTML.
In particular, U+293B BOTTOM ARC ANTICLOCKWISE ARROW “⤻” has rather limited font support. A large number of systems have no font containing it. It could be used rather (though not 100%) reliably using a downloadable font, but it sounds like you are generating HTML-format e-mail messages, so downloadable fonts are hardly a feasible option.
The best short appears to be to an image instead.
What your describe as WordPress usage is a Private Use codepoint. In practice it works only with a particular special font. You can copy and paste it, but outside the private use context such as use on a web page with a specific font, it has absolutely no meaning and should not be expected to have any particular rendering, or any rendering at all.

I need an iOS tool to encode HTML?

I am parsing some XML that will have a link such as the following one in it:
http://sale.images.woot.com/Château_de_Brigue_French_RoséhknStandard.jpg
As you can see this link has accented characters in it. iOS has trouble with this an will not load the image given the link in that form. If I go to Google Chrome and navigate to that image, and copy the link in the address bar, I can see that it has encoded the accented characters as follows:
http://sale.images.woot.com/Ch%C3%A2teau_de_Brigue_French_Ros%C3%A9hknStandard.jpg
However, this doesn't make any sense to me because if I go to W3C's URL Encoding Reference, and swap out the accented characters in the link with the numbers in their ASCII chart, it seems like the link should be
http://sale.images.woot.com/Ch%E2teau_de_Brigue_French_Ros%E9hknStandard.jpg
but this does not work- in my browser or loading into an image view in iOS.
Could someone please explain what's going on? Thanks :)
Also, if someone knows an easy way to encode URLs in iOS that would be great.
EDIT: If you copy and paste the é character from the w3schools website into their URL encoding tool, it will come back as %C3%A9. My previous answer here claimed that they were different characters, but I was wrong. It basically just looks like the table on that page is wrong. In any event, the iOS functions described in this page should give you a good answer to what you need to do for your project.
Use of this methods may help you
escape()
encodeURI()
encodeURIComponent()

What are the HTML entities for up and down triangles?

I've found the outlined versions, but I want the solid up and down triangles.
Does anyone know these entities?
All named HTML entities are specified in chapter 24 of the HTML standard. The only thing missing from the page are rendered entities, but you can easily create your own copy with the additional information by applying a simple regexp:
s/<!ENTITY (\S+)/<!ENTITY \1 &\1;/
Not all entities are named. For many, you need to specify the Unicode code page, either in decimal (▲ ▲, ▼ ▼) or hex (▲ ▲, ▼ ▼).
A little but late, but you can use &blacktriangledown; &blacktriangledown;, and &blacktriangle; &blacktriangle;, to make both the up and down filled in triangles. I was looking for it myself and the alt codes didn't help so I decided to share this. This same thing works for both left and right as well.
I don't know if I've ever seen what you're looking for. Maybe a better way of doing it would be to create the arrows in Photoshop on a transparent background (.gif or .png format), and then load up the images.
Check that, you can do it through alt characters.
http://www.tedmontgomery.com/tutorial/ALTchrc.html
▼ ▲
using the alt characaters on your computer keyboard is a big no no if you are working on a web page for many reasons. #1. encoding of the website, encoding of the database driving the website if any, the codepage of the computer view the website, the codepage your own pc's keyboard is set to.. all that are mostly factors you can not control. So some people will see wonky weird letter combos or sqiggle characters instead of what you intend. For webpages use the html codes for those characters when ever you can. or at least entity encode and make sure you have your code page defined in your html header of your site.. that way people will see what you intend them to.
now if you are doing this in word for a document that will be viewed in your own country you are probably safe. But for online things (site coding or data entry) you should avoid this like the plague.

Is it possible to print DOS characters on a website?

I would like to print some kind of ASCII "art" on a web page in pre-tags. These graphics use DOS characters to show a map like old maze games did. I didn't find anything in the HTML special character reference. Is there a way to use these characters in HTML ?
Thanks in advance.
With the right Unicode characters, the old character encodings shouldn't make much odds. The tricky bit may be converting existing ASCII art into Unicode - at which point you need to know the original encoding.
The relevant code charts will be listed on the Unicode "symbols" charts page. In particular, I suspect you'll find the box drawing and block elements charts useful.
You'll need to make sure that your page uses a font which contains the right characters, of course...
As an example, you can render this:
┌┐
└┘
With:
<pre>┌┐
└┘</pre>
Not quite a proper box, but getting there...
You can send them in the <pre> tags, although in XHTML you'll need to encapsulate it in <![CDATA[[]> I think. Be careful though, not all encodings render this correctly. For example, a lot of ASCII art designed for DOS code page 430 (US) fails over here in the UK (830). Eastern Europe suffers especially.
I think the best approach here would be to render images.
EDIT: Oh. You could try , but I'm not sure if that would work.