Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11

Thread: File Checking

  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts

    Question File Checking

    I know the sticky post by the admin said that I should know what javascript can or cannot do before I post here, but please consider my question anyway.

    I wanted to make a script to check for an installed font component on the user's computer to see if they have the font that I am using, and if not, display a link to the font with some info on it.

    Can this be done using Java, Javascript or ASP??? If it can be done in ASP then i will post in the ASP forum so as to not clog this one up with a useless post

    Please post if it can be done with any, and if it can, which one(s) and, if possible, how i can access the information I need

    Thanks for any help

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72░ W. 48' 57" , 41░ N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i know for certain that it cannot be done with javascript, and i'm pretty sure that it can't be done with java or asp, but not positive of that
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Well, I know that something like this CAN be done because when you try to use some java applets it checks to see if you have the correct SUN JAVA version (if you want to see this, look at RuneScape)
    I dont know if fonts are in the registry or anything though.

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeň, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    That's different - those use internal features of the Java VM. Java can't access the client filesystem from an applet. It's possible there's some interface that allows Java to determine whether the font you want is available or not, but that will rely on whaterver information the OS is willing to hand the VM.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #5
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Well, I was only giving an example of what I wanted to do roughly. I was just hoping some of the more advanced coders would know how to do it or if it DEFINATELY wasn't possible with ANY language such as those mentioned, that can be put online.

  • #6
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    The following page has an example, and if you keep clicking the red arrows it gives a very involved explanation.

    http://www.webreference.com/dhtml/column30/index.html

    I don't have any specific pointers since I never used this script or tutorial, but they seem to cover it in great detail.

  • #7
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Thanks a lot m8 finally, someone who knows what they are talking about and was willing to help.
    I owe you one (but i probably won't pay up, lol)

  • #8
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72░ W. 48' 57" , 41░ N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    1)props to arnyinc for finding that.

    2)
    ... there are no built-in DHTML and JavaScript methods to identify installed fonts on a user's system ...
    liorean and i were right; there is no built in way to do this. these guys came up with a hack for it. a clever hack, but a hack nonetheless.

    3)
    Originally posted by ghell
    finally, someone who knows what they are talking about and was willing to help.
    that's not a very friendly thing to say
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #9
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    im guna drift off topic 'cos arnyinc answered my question

    why isnt it a nice thing to say anyway??? only one person gave me a method of doing what i wanted to do, and i was thanking him. he knew what he was talking about because he knew how to do it. you didnt know how to do it
    also the method used is NOT A HACK ... ur a moderator and you dont even know what a hack is ... how stupid is that (not you, THAT)
    It checks the size that the font takes up to see if it works.. and that is a hack because..... exactly, it isn't!!

  • #10
    New Coder
    Join Date
    Jul 2002
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ohh!There's a problem.You can't use JavaScript while you want to remote control etc. the files.You can use VBScript.

    Sample:
    <Script Language="VBScript">
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.fileExists("X:\MyDocument.doc")) then
    MsgBox "OK",0,""
    Else
    MsgBox "Sorry",0,""
    End If
    </Script>

    Ho■šakal!*

    *= It means bye in our language.
    Do you know Hakki Ocal ?

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by ghell
    also the method used is NOT A HACK ... ur a moderator and you dont even know what a hack is ... how stupid is that (not you, THAT)
    It checks the size that the font takes up to see if it works.. and that is a hack because..... exactly, it isn't!!
    Seems like you have a different understanding of what a hack is than others, for example me. Judging from the elaborate description at http://info.astrian.net/jargon/Hacke...g_of_Hack.html this font detecting would qualify as a hack. At least for me.
    Have you another definition for "hack" and "hacking"? Oh, and that script doesn't work in Mozilla. Duh.


  •  

    Posting Permissions

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