navigating to a page disables font

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

navigating to a page disables font

11 Dec 2018, 13:53

When travelling to a html page. The font-face rule seems to stop working in the ahk script. Here's the example of the script I'm using.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

htmlpath := A_scriptdir . "\Htmlfile.html"
gui Window:default
gui, add, edit, h0 w0
gui, font, s10
gui +Border +lastfound
menuwidth := A_screenwidth / 3
menuheight := A_screenheight / 2

Gui, Add, ActiveX, x0 y0 w%menuwidth% h%menuheight% vmenu, Shell.Browser
menu.navigate(htmlpath)
gui, show
return

F11::
Reload
return
And here's the html file

Code: Select all

<!DOCTYPE html>
<html>
    <head>
        <title>a</title>
        <meta charset='UTF-8'>
        <meta name='viewport' content='width=device-width, initial-scale=1.0'>
        <meta http-equiv='X-UA-Compatible' content='ie=edge'>
        <style type=text/css>
            html {
                overflow:hidden;
                height:100%;
            }
            body {
                background:#888888;
                width:100%;
                height: 100%;
            }
            @font-face {
                font-family:'Myfont';
                src:url('opensans-bold.woff') format('woff');
            }
            .custom{
                font-family:'Myfont';
            }
        </style>
    </head>
    <body>
        <p class='custom'>Aa</p>
    </body>
</html>
When opening the html file in a browser. The font does work Image
However the font does NOT work when navigating to the html page using the script Image
Any clues on how to solve this. I already have this problem with no solution already for over a week.

One more thing. It seems like showing the font on the ahk script does work for some time until I start doing various things on my computer. For example. Saving an image anywhere in paint.net breaks all ahk script that navigate to a html file with a font until I restart my pc.

Also here's a download link to the file where I got a script, font and html file so you could test for yourself. Link
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: navigating to a page disables font

11 Dec 2018, 23:37

setting the client version of ie to the latest usually works but I forget how...
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: navigating to a page disables font

12 Dec 2018, 08:39

TLM wrote:
11 Dec 2018, 23:37
setting the client version of ie to the latest usually works but I forget how...
What exactly do you mean with this? Do you mean this as a setting in ahk or something I'd have to put in the html code or ahk code?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder, ziru and 313 guests