Uploading custom fonts on your website - javascript

Good day. I am creating a simple website that adds text to the canvas. But I want the user to upload their own custom fonts and use it in the site. How can do that? I have seen that before you can use the font you still need to be write it in css.

This may point you in the right direction...
http://www.w3schools.com/php/php_file_upload.asp
Also remember that google fonts is a large fonts database to you can direct your users to...
www.w3schools.com/js/js_htmldom_css.asp
If you mess around with this ^^^ than you may figure it out...
Remember though that many browsers allow you to turn off JavaScript...
Also there are ways to change css values with php...
The best thing to try is... assuming that the users font is in their fonts directory on their computer... you can direct the user to type in the exact name of the font and it SHOULD detect the font...
Just keep chugging on :D

I've never heard or seen that done before, even as a feature request lol.
How about maybe letting the user choose their own Google web font, that way you at least know what all the choices are.
Then you could either hardcode the font styles for a few Google web fonts, or have your app created new CSS files based on what font they choose.
Good luck!

Related

Protect an image without using a plugin

I want to completely protect an image, not just right click protection which can be easily thwarted.
I tried editing the graphics folder permissions in cPanel but that made the image disappear.
Is there any other way to protect an image from being stolen that is completely foolproof.
EDIT
I cannot watermark this image so I need another way.
EDIT 2
I just combined the base64 dataURL and right click protection. So I'm pretty much covered except for screenshots which I'm not that worried about. If only it was possible to keep people from taking a screenshot like using some freaky DRM tricks or something.
It can't be done. You can use a few tricks to make it more difficult, but the truth is once you sent that image over the wire, the user will be able to save it, share it, etc.
Watermark your valuable images or publish low res versions of them.

Advice and considerations for converting HTML4 to HTML5 website.

I have a website that I need to convert to HTML5. I need advice and whether it can truly be converted to an HTML5.
Please tell me, how I should start? Should I just start using HTML5 code in lieu of existing HTML4.
I will need to later add video content and a image scroller. Also if need be, should I redesign the site from scratch? I dont think this should be a problem.
Also the site is not friendly with form factors other than deskop/laptop.
It does not work well with mobile small display for which case HTML5 is anyways needed.
Do not hesitate or think too much. I need to know what you guys have in mind before I take a major step. I need to do this in under a month, I cannot afford to waste anymore time on it.
I have used gimp to make the icons for this website, but i dont think much of those icons will be needed with the new code.
Also, should I make a design prototype in gimp for my website. Later on I can add the css/html5. Do you think its worth the extra time or should I use one of the ready made templates?
Yes any site can be converted in HTML5. It is simple process, first you have to change doctype from old to new which is very short doctype. Please change your doc type statement on top of site to following.
<!DOCTYPE html>
Meta coding also another thing you need to change from old version to latest which is following.
<meta charset="utf-8">
After changing your meta coding now see all div and change them to Semantics div. In past we used mostly div to separate part or to design our layout. Now try to see if some div have any specific meaning like header, footer, article, section and convert them accordingly. Only remaining div should for design purpose but all other who have specific meaning should be converted to tags which are provided by HTML5.
Now another thing need to be done is Nav, where ever you see navigation please put it in tag as html5 uses this tag to specify list of links.
When you do all this there is possibility that old browser would not support so to bring support back use add Shiv a javascript that bring these special tags in previous version of html. Now change your css as all div you change require redefining tag instead of div in css too.
As for your part of Mobile version or sizing it is not of HTML5 but it is about CSS you have to use media queries in css to customise different styles for different size. Media query will let you know what size of display is and than you have to add styles and do changes some big parts break in linear format to give perfect view in Mobile and Menu be removed and a button is added.
Now add video and other media but remember that different video formats are supported by different browser so you have to provide multiple format to be used in html5 video. Also have to use for compatibility purpose old flash.
GIMP you can use if you want to redesign or change design of site otherwise for html5 I don't see its usage.
You don't have to use GIMP to design everything from scratch, follow the steps described here:
http://www.w3schools.com/Html/html5_migration.asp
they will guide you to convert your existing website to use HTML 5

Can an image be included in a webpage but protected from copying/saving? [duplicate]

This question already has answers here:
Preventing a visitor from saving an image from my site
(15 answers)
Closed 8 years ago.
I have a website where I display digital proofs for clients of professional photographers. I would like to include an option of 'zooming' into the full resolution version of the image, but it is absolutely imperative that it be practically impossible for the end user to reconstruct and save/print the image.
Obviously simply disabling right clicking is out, as the user could simply dig up the image in the cache. Breaking the image into tiles, then reconstructing them via javascript has merit; the user could still dig up the tiles and put them together in Photoshop, but is that practical for them? That's up for debate. I was also wandering today if the image couldn't be read, sent as a character string of pixel color values, and then constructed on the client side using an absolutely positioned element for each pixel.
But my potential solutions seem to be getting more and more ridiculously convoluted. And I'd like something that's been tested and shown to be scalable. I can't possibly be the first to deal with this problem. Is there something else out there that I don't know about? What is the standard, accepted way to do this?
As an aside, I am aware that I will want to make the image data unavailable to external http requests. I would plan to have ColdFusion read the image file on demand and stream it to the client.
Thanks!
No matter what you do, someone could always screen capture the page. Keep a watermark on the full resolution image.
With 100% reliability, no. For an image to be displayed, it has to be downloaded onto the client's browser, and therefore CAN be retrieved.
You can make it harder for them to extract the image through various techniques, but none of them make it impossible - if nothing else, they can always just make a screen capture:
slice/dice the image into multiple pices and use table-based layouts to make it appear as a single image
javascript right-click disablers
various cache headers to try and prevent client-side cacheing
CSS overlays to try and prevent right-click->save as on the image itself
display in a Flash/Java app
etc... etc...
None are 100% reliable, and are all trivial to bypass by a determined (and even slightly knowledgeable) user.
You can't, unless you sell specific hardware, even then people can put a camera in front screen and take pictures
You can water mark your images
You can actively sue who ever steals your pictures (that is in reference to how others solve this).
Nicholas,
As you pointed, there is no protection against Print Screen.
I would suggest you to implement the media protection of sites like Image Bank (http://www.gettyimages.com), but is mostly based in NOT displaying full resolution images and heavy watermarking ...
I don't think there is a practical solution to your problem (if any).
Good luck!

Browser Plugin?

I want to design a system where user can give a specific font size from a settings and whole site will be changed and every writing would be of that font size. Now i think I have to develop a browser plugin. however, if any of you can suggest that without using browser plugin i can do that, then definitely I want to know that. [ here user will be able to modify the site from the browser ,user has nothing to do with the existing sites coding what so ever]
Please don't develop a plug-in just for that.
Unless you're working with really old browsers (IE6 and such) that would not scale fonts specified in certain units, all modern browsers have menu and keyboard settings to change the font size. Let the users use those.
You can also use a bit of Javascript to display "bigger/smaller" buttons somewhere and either replace a stylesheet file or adjust the default font size of the <body> element and have the rest of the elements derive percentages from it.
I don't know about other way to do it,but anyway plugin won't help you.
See this excellent article: http://colonelpanic.net/2010/08/browser-plugins-vs-extensions-the-difference/
You mean a browser extension. As you can see in the article- if you want to write an extension to IE use BHO. For Firefox see https://developer.mozilla.org/en/XUL_School

Anti-aliased text with css/javascript for Large font size?

I am using Large fonts in my website at a few places and they don't appear anti-aliased or smooth... I was wondering if their is any way to show large anti-aliased fonts for browsers on windows OS which has anti-aliasing switched off as default... Similar to something they have on this website here
You can't control system anti-alias in CSS.
For that, you would have to use Flash text replacement, like sIFR (they are using h2swf)
If the user's OS or browser does not have anti-alias switched on, there's nothing you can do to force either to use it. You can use other rendering platforms like Flash, or using CCS to replace text with images, to allow fonts to be displayed with anti-aliasing, but it does seem like a kludge for something as simple as rendering text. Technologies like Flash will also alienate certain audiences, either whose devices have no support for them or they simply opt out of using them.
If your user does not have AA enabled, arguably they are displaying a preference or simply don't care about the particulars of how the font is rendered. At the end of the day, you simply cannot directly control the client your users will use to consume your website. On the web you will always be at the mercy of the client application. The best you can do is present it clearly and in such a way that it should be easy for users to get the best experience they can achieve with their client.
Don't lose any sleep over whether your pixels are slightly less pretty on one client.
Cufon is an alternative to sIFR. See comparison here:
http://net.tutsplus.com/tutorials/html-css-techniques/six-ways-to-improve-your-web-typography/
Good news : in IE9 (released 3/14/11) they seem to put much larger text as anti aliased by default. I have hardware acceleration disabled - so it probably has this effect for all users.
Warning: this is an exercise in futility but....
I did notice that the text-shadow css property seems to force anti aliasing in some browsers. Unfortunately I think only Chrome at this time...
Here's a sample...
(each heading is shown first normally - and then with a text shadow).
Best viewed in Chrome!

Categories

Resources