summaryrefslogtreecommitdiff
path: root/!NetSurf
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-04-09 21:06:10 +0000
committerJames Bursa <james@netsurf-browser.org>2004-04-09 21:06:10 +0000
commite90e01cd49c2ef320580bb838cedec3430f55116 (patch)
tree0d7268f587960e44281fafb03f3b8638100c0f26 /!NetSurf
parent9de746e0a00ad6055a0d4797cd66c1b62b4cc5d6 (diff)
downloadnetsurf-e90e01cd49c2ef320580bb838cedec3430f55116.tar.gz
netsurf-e90e01cd49c2ef320580bb838cedec3430f55116.tar.bz2
[project @ 2004-04-09 21:06:10 by bursa]
Add FixFonts to attempt to fix common font problem. svn path=/import/netsurf/; revision=741
Diffstat (limited to '!NetSurf')
-rw-r--r--!NetSurf/FixFonts,ffb147
-rw-r--r--!NetSurf/Resources/en/Messages2
-rw-r--r--!NetSurf/Resources/fr/Messages2
3 files changed, 151 insertions, 0 deletions
diff --git a/!NetSurf/FixFonts,ffb b/!NetSurf/FixFonts,ffb
new file mode 100644
index 000000000..c6b73d0b0
--- /dev/null
+++ b/!NetSurf/FixFonts,ffb
@@ -0,0 +1,147 @@
+REM Attempt to fix broken font installations which have non-Base0 copies of the
+REM ROM fonts in !Fonts on disc.
+
+ON ERROR ON ERROR OFF: PRINT REPORT$ + " (at line " + STR$ERL + ")": END
+
+DIM f$(11)
+f$() = "Corpus.Bold","Corpus.Bold.Oblique","Corpus.Medium","Corpus.Medium.Oblique","Homerton.Bold","Homerton.Bold.Oblique","Homerton.Medium","Homerton.Medium.Oblique","Trinity.Bold","Trinity.Bold.Italic","Trinity.Medium","Trinity.Medium.Italic"
+
+PRINT "FONT INSTALLATION FIX"
+PRINT
+
+PRINT "Checking ROM fonts"
+PRINT
+ok% = TRUE
+FOR f% = 0 TO 11
+ PROCcheck_rom_font(f$(f%))
+NEXT
+PRINT
+IF NOT ok% THEN
+ PRINT "One or more of the standard ROM fonts are missing!"
+ PRINT "Please contact the developers stating your RISC OS version."
+ END
+ENDIF
+
+
+PRINT "Searching for obsolete copies in Boot:Resources.!Fonts"
+PRINT
+ok% = TRUE
+FOR f% = 0 TO 11
+ PROCcheck_disc_font(f$(f%))
+NEXT
+PRINT
+IF ok% THEN
+ PRINT "No problems were found."
+ END
+ENDIF
+
+PRINT "One or more obsolete fonts were found in !Fonts."
+PRINT
+PRINT "Press Y to move these fonts to a new directory"
+PRINT "called 'ObsolFonts' and remove them from the"
+PRINT "font list ('Messages1'),"
+PRINT "or any other key to exit without changes."
+key$ = GET$
+IF INSTR("Yy", key$) = 0 THEN
+ PRINT
+ PRINT "Exiting without changes."
+ END
+ENDIF
+PRINT
+
+PRINT "Creating 'ObsolFonts' directory - ";
+SYS"OS_File", 8, "<Boot$Dir>.^.ObsolFonts"
+PRINT "done"
+PRINT
+PRINT "Closing open files - ";
+SYS"OS_FSControl", 22
+PRINT "done"
+PRINT
+PRINT "Removing fonts from font list - ";
+file% = OPENIN "<Boot$Dir>.Resources.!Fonts.Messages1"
+IF file% THEN
+ new% = OPENOUT "<Boot$Dir>.Resources.!Fonts.Messages_"
+ IF new% = 0 THEN
+ PRINT "Failed to open new font list"
+ END
+ ENDIF
+ WHILE NOT EOF#file%
+ line$ = GET$#file%
+ ok% = TRUE
+ FOR f% = 0 TO 11
+ IF INSTR(line$, "Font_" + f$(f%) + ":") <> 0 THEN ok% = FALSE
+ NEXT
+ IF ok% THEN
+ BPUT#new%, line$
+ ENDIF
+ ENDWHILE
+ CLOSE#file%
+ CLOSE#new%
+ SYS"OS_File", 18, "<Boot$Dir>.Resources.!Fonts.Messages_", &fff
+ SYS"XOS_FSControl", 27, "<Boot$Dir>.^.ObsolFonts.Messages1"
+ SYS"OS_FSControl", 25, "<Boot$Dir>.Resources.!Fonts.Messages1", "<Boot$Dir>.^.ObsolFonts.Messages1"
+ SYS"OS_FSControl", 25, "<Boot$Dir>.Resources.!Fonts.Messages_", "<Boot$Dir>.Resources.!Fonts.Messages1"
+ENDIF
+PRINT "done"
+PRINT
+PRINT "Moving away obsolete fonts"
+PRINT
+FOR f% = 0 TO 11
+ PROCfix_font(f$(f%))
+NEXT
+PRINT
+PRINT "Finished"
+PRINT "Please restart your machine for the changes to take effect."
+
+END
+
+
+
+DEF PROCcheck_rom_font(f$)
+PRINT " "; f$;
+SYS"OS_File", 17, "Resources:$.Fonts." + f$ + ".Outlines0" TO t1%
+SYS"OS_File", 17, "Resources:$.Fonts." + f$ + ".IntMetric0" TO t2%
+IF t1% = 1 AND t2% = 1 THEN
+ PRINT " - ok"
+ELSE
+ PRINT " - MISSING"
+ ok% = FALSE
+ENDIF
+ENDPROC
+
+
+
+DEF PROCcheck_disc_font(f$)
+SYS"OS_File", 17, "<Boot$Dir>.Resources.!Fonts." + f$ + ".Outlines" TO t%
+IF t% <> 0 THEN
+ PRINT " "; f$
+ ok% = FALSE
+ENDIF
+ENDPROC
+
+
+
+DEF PROCfix_font(f$)
+SYS"OS_File", 17, "<Boot$Dir>.Resources.!Fonts." + f$ + ".Outlines" TO t%
+IF t% = 0 THEN ENDPROC
+
+PRINT " "; f$; " - ";
+i% = 0
+REPEAT
+ i% = INSTR(f$, ".", i% + 1)
+ IF i% <> 0 THEN
+ SYS"OS_File", 8, "<Boot$Dir>.^.ObsolFonts." + LEFT$(f$, i% - 1)
+ ENDIF
+UNTIL i% = 0
+SYS"OS_File", 8, "<Boot$Dir>.^.ObsolFonts." + f$
+
+SYS"OS_FSControl", 25, "<Boot$Dir>.Resources.!Fonts." + f$ + ".Outlines", "<Boot$Dir>.^.ObsolFonts." + f$ + ".Outlines"
+
+SYS"OS_File", 17, "<Boot$Dir>.Resources.!Fonts." + f$ + ".IntMetrics" TO t%
+IF t% <> 0 THEN
+ SYS"OS_FSControl", 25, "<Boot$Dir>.Resources.!Fonts." + f$ + ".IntMetrics", "<Boot$Dir>.^.ObsolFonts." + f$ + ".IntMetrics"
+ENDIF
+
+PRINT "done"
+ENDPROC
+
diff --git a/!NetSurf/Resources/en/Messages b/!NetSurf/Resources/en/Messages
index 0cec9c379..05bb8f9c7 100644
--- a/!NetSurf/Resources/en/Messages
+++ b/!NetSurf/Resources/en/Messages
@@ -49,6 +49,8 @@ ErrorPage:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/T
InvalidURL:The address <em>%s</em> could not be understood.
NoMemory:NetSurf is running out of memory. Please free some memory and try again.
+FontBadInst:An error occurred when initialising fonts due to the presence of obsolete copies of the ROM fonts on disc. NetSurf will exit and launch a program which will attempt to fix this.
+FontError:Failed to open font "Homerton.Medium" (%s).
Loading:Opening page...
RecPercent:Received %lu of %lu bytes (%u%%)
diff --git a/!NetSurf/Resources/fr/Messages b/!NetSurf/Resources/fr/Messages
index 7d04cf931..3536bb234 100644
--- a/!NetSurf/Resources/fr/Messages
+++ b/!NetSurf/Resources/fr/Messages
@@ -49,6 +49,8 @@ ErrorPage:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/T
InvalidURL:L'adresse <em>%s</em> est incomprise.
NoMemory:NetSurf a besoin de plus de mémoire. Veuillez libérer de la mémoire et réessayer.
+FontBadInst:An error occurred when initialising fonts due to the presence of obsolete copies of the ROM fonts on disc. NetSurf will exit and launch a program which will attempt to fix this.
+FontError:Failed to open font "Homerton.Medium" (%s).
Loading:Ouverture de la page...
RecPercent:%lu reçus de %lu octès (%u%%)