+ Post New Thread
Results 1 to 6 of 6
Web Development Thread, Force a font in Coding and Web Development; is it possible to force a font down through all styles? im having a problem where font declerations from word ...
  1. #1
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    972
    Thank Post
    102
    Thanked 116 Times in 101 Posts
    Rep Power
    74

    Force a font

    is it possible to force a font down through all styles?

    im having a problem where font declerations from word are being passed into a schools website. and i know that if i spend my afternoon fishing out all the style declerations from the page sources it will be fine untill they copy another word doc in and i have this problem all over again. so is it possible to force a style to go down all the levels and over ride any stlyes declared on the fly?

  2. #2
    p858snake's Avatar
    Join Date
    Dec 2008
    Location
    Queensland
    Posts
    1,490
    Thank Post
    37
    Thanked 175 Times in 151 Posts
    Blog Entries
    2
    Rep Power
    51
    nope, its the way css ordering works, for example spans and such will over ride whatever is applied before. unless you possibly try the add the css link/import at the end of the document.... (i haven't tried that so it might not work)

  3. #3

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,403
    Thank Post
    637
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319
    The real mistake is copying directly from Word. Copy to Notepad first to remove all formatting, then copy to the web as normal.

  4. #4
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    972
    Thank Post
    102
    Thanked 116 Times in 101 Posts
    Rep Power
    74
    Quote Originally Posted by webman View Post
    The real mistake is copying directly from Word. Copy to Notepad first to remove all formatting, then copy to the web as normal.
    yep, it would work even better if instead of typing it in word they typed it into the lovely WYSIWYG editor on the site.

    Quote Originally Posted by p858snake
    nope, its the way css ordering works, for example spans and such will over ride whatever is applied before. unless you possibly try the add the css link/import at the end of the document.... (i haven't tried that so it might not work)
    i was afraid of that.

    time for some lovely REGEX in php to remove the styles

  5. #5

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,403
    Thank Post
    637
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319
    @Arcath: Yes, even better if they did that!

    To get the bare-basics, you might be able to use strip_tags() and then nl2br().

  6. Thanks to webman from:

    Arcath (5th October 2009)

  7. #6
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    972
    Thank Post
    102
    Thanked 116 Times in 101 Posts
    Rep Power
    74
    Thanks, been looking into it, word seems to use every method of deinining styles known to man, and the source is a nasty thing. I can strip out the word c**p but then alignment etc... bear no ressemblent to what it looks like in the editor (cause that still has word formatting).

    im just gonna have to go through all the pages one at a time and fix the formatting and then put a big thing above the editor about pasting from word

SHARE:
+ Post New Thread

Similar Threads

  1. What Font
    By mossj in forum Graphics Requests
    Replies: 14
    Last Post: 4th July 2009, 10:42 PM
  2. C++ The name of font being used
    By Pashers in forum Coding
    Replies: 2
    Last Post: 4th February 2009, 02:36 PM
  3. looking for a font
    By RabbieBurns in forum How do you do....it?
    Replies: 3
    Last Post: 5th December 2008, 08:38 AM
  4. What font do you use??
    By maniac in forum General Chat
    Replies: 29
    Last Post: 19th December 2007, 01:09 PM
  5. Which font... ?
    By WithoutMotive in forum General Chat
    Replies: 22
    Last Post: 24th May 2007, 11:31 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •