Considering how regularly new versions of Firefox now come along, that's quite some bug fix list in version 10! http://t.co/K3I2vLpW 1 week ago


26th
Oct 11

How to use the Android 4 Roboto font on your website



If you wish to use a non-standard font for your website then there are a number of ways to do this. However, I prefer to use the font-face CSS option. It’s not without its disadvantages, so read up on it before proceeding.

For each font that you wish to add simply add the following code to your CSS…

@font-face {
    font-family: 'DroidSansRegular';
    src: url('DroidSans-webfont.eot');
    src: url('DroidSans-webfont.eot?#iefix') format('embedded-opentype'),
         url('DroidSans-webfont.woff') format('woff'),
         url('DroidSans-webfont.ttf') format('truetype'),
         url('DroidSans-webfont.svg#DroidSansRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

You’ll need to change the font-family to the name that you wish to give the font. Then there are 5 references to the font files – 4 different types to cover different browser requirements. Again, these will need changing appropriately.

This site previously used the font named Droid, which is the open source font used by Android. With last week’s introduction of Android 4, however, they’ve created a new font named Roboto – this has been designed for HD screens, so is perfect for websites.

If you wish to use either of these fonts, I’ve bundled them up ready for font-face (i.e. with each of the 4 formats that are required).

Download Droid

There are 3 versions of the font – standard, bold and mono space.

Download Roboto

There are 2 versions of the font – standard and bold.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



25th
Oct 11

Copying to clipboard in WordPress


I was recently asked, as a commercial request, to create a WordPress plugin that would allow users to click a button and copy text the clipboard. It seemed an easy enough thing to do – 2 weeks later, though, and I’ve thrown in the towel.

Using JavaScript to capture contents is the easy bit – adding it to the clipboard is a lot more difficult. IE has a JavaScript command built in, other browsers vary. Unfortunately, other browsers (e.g. Firefox) also restrict this ability for security reasons. This is because the ability to write to the clipboard also comes with the ability to read from it as well – quite why this functionality can’t be detached and restrict just the reading I don’t know.

So, using JavaScript is problematic.

Thankfully I’m not the first to come across this problem and a third party script named ZeroClipboard is available. This uses Flash to update the clipboard, which doesn’t have the same security limitations. Of course if you’re viewing from a device that doesn’t support Flash (cough, splutter, iPad, iPhone, cough) then you’re still out of luck. None-the-less this seemed a perfect solution.

Unfortunately, my limited JavaScript skills failed me – I found the program to be over-complex for what I needed and failed to be able to get it to work.

At this point I found an alternative – ZClip uses ZeroClipboard but is controlled via JQuery (which is built into WordPress) and provide a much easier and friendly method of access.

I was now in a position where I had a working plugin. Until I used Admin Bar. That seemed to affect the positioning of the Flash overlay so you had to click slightly above the “Copy to clipboard” button to get it to work.

The customer, though, didn’t have an issue with this and I could only hope that they didn’t have anything else within their theme or plugins that could affect it in this way (I did try contacting the developer of Zclip but got no response).

What really ended it all though was the limited way of capturing text in zclip, which I hadn’t appreciated earlier on. ZClip can capture in 2 ways – from static fields (e.g. the text between a SPAN) or dynamic (e.g. from a field). The first doesn’t capture any formatting, even paragraph breaks – returning everything as one long line of text. The second did, but by capturing the HTML.

The customer wanted the customer to be able to copy to the clipboard long paragraphs of text – neither offered a neat solution to this.

Then I gave up. One day I may return to it – certainly ZeroClipboard will probably allow me to do what I need it to, but I’ll have to get my head around how to first.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



31st
Aug 11

UK2.net Hosting


While I was moving  something else happened – this site’s bandwidth limit was reached and the site went down. As you can imagine, I didn’t even notice.

My host is Memset who, I have to say, are superb. But you pay for that quality and I was already having to pay more than I was last year due to bandwidth increases (you pesky visitors keep coming here!). There’s only so much money you can throw at something though before you have to have a bit more of a radical re-think. So, I made the decision to move my hosting  to UK2 and one of their rather professional looking business packages. Bandwidth would no longer be an issue but, as is often the case with cheaper providers, the occasional downtime may be.

I pointed my domain (which is held at 1&1) to the UK2 servers and although my holding page was now appearing I couldn’t get FTP access. I raised a support request but didn’t hear anything until last night – it had taken some time for the IP changes to be propagated to their FTP server. This morning it was working so I uploaded the site but I was still getting the holding site. Another support request and they noticed that my site was pointing to the wrong IP. Now corrected, my site was live! Unfortunately I was getting server configuration errors – this was using an exact snapshot of the site as held by Memset.

Meantime, Memset had contacted me and I was in a position where I could double my bandwidth by paying just £1 extra a month.

By this time the decision was now easy. I have swapped my nameservers back to Memset and have cancelled my UK2 hosting – thankfully they have a 30 day money back guarantee.

Unfortunately, it comes with  a sting in its tail – they haven’t refunded me all my money. They have retained an administration fee for the free domain they provided me…

When you purchase the Business web hosting a free domain comes with it, because you are keeping the domain and cancelling the web hosting we have deducted the registration fee.

I’ve pointed out that they didn’t actually provide me with a new domain, I’d simply pointed my existing one to their nameservers at no cost to them. Eventually, they relented and paid me my full amount.

But, right now, I’m just happy to have the site working. Welcome back Memset!

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly