Jump to content
Rpg²S Forum

*Auto Font Install


Andre4e
 Share

Recommended Posts

Auto Font install

Descrizione

 

In questo forum non mi è sembrato di trovarlo quindi lo posto qui!
Questo script installa automaticamente i font per il tuo gioco!

Autore

 

Autore originale wachunga
Tradotto da Andre4e

Allegati

Demo


Screenshot:


post-2796-1251802380_thumb.png

 

Istruzioni per l'uso

 

Inserite lo script in una cartella sopra main
Istruzioni all'interno dello script
Questo script necessita di un file "fileutils.rb" che troverete nella cartella data

Script:

 

 

#==============================================================================
# ** Auto Font Install
#------------------------------------------------------------------------------
# Wachunga Tradotto da:
# Version 1.1 Andre4e
# 2006-05-26
#------------------------------------------------------------------------------
=begin

Italiano

Questo script installa automaticamente i font!
Istruzioni:
1)Creare una cartella all'interno della cartella del
gioco chiamata (Vedi Module fonts), se non è stata
cambiata la cartella si deve chiamare Fonts
2)all'interno della cartella Fonts,inserire i
font che si desidera installare
3)Andare alla riga 80 al Module Fonts e inserire
il nome del font come richiesto
4)Questo script per funzionare ha bisogno di
un file chiamato "fileutils.rb" e che deve esssere
inserito nella cartella data
5) è compatibile con sdk. se si usa l'sdk
togliere l'asterisco alle righe 69,74,162

English
Automatically installs one or more fonts so the player doesn't have to. It
only does this the first time the game is run and the process is quite
transparent (notification to the player is optional).

Thanks to MagicMagor for the pointer to one of the Win32 functions.

FEATURES
- handles installation of fonts so players don't have to
- supports multiple fonts
- process is quite transparent

SETUP
Create a Fonts folder in the game directory and place all fonts to be
installed within. Then update the Filenames and Names constants below,
adding an element to both arrays for each font.

This script only installs the fonts on the player's computer. You'll
still have to refer to them as necessary within the game,
e.g. by setting a new default as follows (in main):
Font.default_name = [Fonts::Names[0], 'MS PGothic']

This script uses the SDK, available from:
[url="http://www.rmxp.org/forums/showthread.php?t=1802"]http://www.rmxp.org/forums/showthread.php?t=1802[/url]

(To remove this dependency, just delete the three SDK-labeled lines,
including the 'end' at the bottom of the script.)

This script also requires the free FileUtils module by Minero Aoki, which
is included in the standard Ruby distribution but for some reason not
available in RMXP. Download and place it in your scripts subdirectory:
[url="http://s88387243.onlinehome.us/rmxp/auto_font_install/fileutils.rb"]http://s88387243.onlinehome.us/rmxp/auto_f...ll/fileutils.rb[/url]

Note: if player does not have the rights to install fonts on their machine,
this probably won't work -- but then they wouldn't be able to do it manually
	either. :)
	
	=end
	
	#------------------------------------------------------------------------------
	# * SDK Log Script
	#------------------------------------------------------------------------------
	#SDK.log('Auto Font Install', 'Wachunga', 1.1, '2006-05-26')
	
	#------------------------------------------------------------------------------
	# * Begin SDK Enabled Check
	#------------------------------------------------------------------------------
	#if SDK.state('Auto Font Install') == true
	
	
	
	
	
	module Fonts
		# Nome dei font che devo essere installati
		# Inserire anche l'estensione
		Filenames = ['Harrington.TTF','OLDENGL.TTF']
		
		# Nome dei font, non dei file.
		# Per visualizzare il nome del font, fare doppio
		# clic su esso
		Names = ['Harrington','Old English Text MT']
		
		# True = Visualizza messaggio di installazione
		# false = Non lo visualizza
		Notify = true
		
		# Cartella contenente i font da installare
		# La cartella deve essere all'interno della
		# cartella del gioco
		Source = 'Fonts/'
		
		# Cartella dove installare i font
		# Non modifcare
		Dest = ENV['SystemRoot'] + '\Fonts\\'
	end
	
	class Scene_Title
		
		AFR = Win32API.new('gdi32', 'AddFontResource', ['P'], 'L')
		WPS = Win32API.new('kernel32', 'WriteProfileString', ['P'] * 3, 'L')
		SM = Win32API.new('user32', 'SendMessage', ['L'] * 4, 'L')
		WM_FONTCHANGE = 0x001D
		HWND_BROADCAST = 0xffff
		
		alias wachunga_autofontinstall_st_main main
		def main
			success = []
			for i in 0...Fonts::Filenames.size
				f = Fonts::Filenames[i]
				# check if already installed...
				if not FileTest.exists?(Fonts::Dest + f)
					# check to ensure font is in specified location...
					if FileTest.exists?(Fonts::Source + f)
						require Dir.getwd + '/Data/fileutils.rb'
						# copy file to fonts folder
						FileUtils.cp(Fonts::Source + f, Fonts::Dest + f)
						# add font resource
						AFR.call(Fonts::Dest + f)
						# add entry to win.ini/registry
						WPS.call('Fonts', Fonts::Names[i] + ' (TrueType)', f)
						SM.call(HWND_BROADCAST,WM_FONTCHANGE,0,0)
						if FileTest.exists?(Fonts::Dest + f)
							success.push(Fonts::Names[i])
						else
							print "Auto Font Install:\n\nFailed to install " +
							Fonts::Names[i] + '.'
						end
					else
						print "Auto Font Install:\n\nFont " + f + " not found."
					end
				end
			end
			if success != [] # one or more fonts successfully installed
				if Fonts::Notify
					fonts = ''
					success.each do |f|
						fonts << f << ', '
					end
					print "Auto Font Install:\n\nSucessfully installed " + fonts[0..-3] +
					'.'
				end
				# new fonts aren't recognized in RMXP until the program is
				# restarted, so this is (unfortunately) necessary
				a = Thread.new { system('Game') }
				exit
			end
			wachunga_autofontinstall_st_main
		end
		
	end
	
	#------------------------------------------------------------------------------
	# * End SDK Enable Test
	#------------------------------------------------------------------------------
	#end

 



Bugs e Conflitti Noti

 

N/A

Altri Dettagli

 

N/A

Edited by Dilos
Applicato tag code.

 

 

http://files.nireblog.com/blogs4/narutozorro9kolas/files/firma-naruto-y-yondaime.gif

 

 

Link to comment
Share on other sites

Non lo ho ancora provato ma davvero molto utile, lo userò nel mio game XD

"Oh perché dobbiamo essere così, noi? – ci domandiamo talvolta allo specchio - con questa faccia, con questo corpo? – alziamo una mano, nell'incoscienza; e il gesto ci resta sospeso. Ci pare strano che l'abbiamo fatto noi. Ci vediamo vivere. […] In certi momenti di silenzio interiore, in cui l'anima nostra si spoglia di tutte le funzioni abituali, e gli occhi nostri diventano più acuti e più penetranti, noi vediamo noi stessi nella vita, e in se stessa la vita, quasi in una modalità arida, inquietante; ci sentiamo assaltare da una strana impressione, come se, in un baleno, ci si chiarisse una realtà diversa da quella che normalmente percepiamo, una realtà vivente oltre la vista umana, fuori delle forme dell'umana ragione." [L.P.]

 

http://img43.imageshack.us/img43/4231/vgmiud3f.png

 

 

http://rpg2s.net/gif/SCContest1Oct.gif http://www.rpg2s.net/img/fablecontest3rd.png http://rpg2s.net/gif/SCContest1Oct.gif

 

RPG by forum

 

 

 

 

 

 

 

 

 

 

http://img59.imageshack.us/img59/6/av2w.png

Nome: Erech (In elfico "lancia solitaria", da er (ereb) = "solitario" e ech = "lancia")

 

Età: 19

 

Razza: Umani

 

Descrizione: Erech è un ragazzo alto e slanciato, dalla corporatura tonica e scattante. Ha capelli lunghi e violacei come gli occhi che però sono spesso coperti in parte da un elegante cappello nero. Veste con uno stile classico, una camicetta bianca sotto una giacca nera e un fiocco al collo ornato con un'immancabile piuma azzurra. Gli piace leggere e scrivere e ama tradurre testi in lingue antiche.

 

Carattere: Il ragazzo ha un carattere chiuso e introverso, è di poche parole e preferisce i fatti alle parole. Non si relaziona spesso con i coetanei o se lo fa significa che si fida cecamente della persona che ha davanti; è diffidente e tende a non raccontare fatti del suo passato, belli o brutti che siano.

 

 

Link to comment
Share on other sites

Lo imposta anche al gioco?

SEEP Universe su Steam:

http://cdn.akamai.steamstatic.com/steam/apps/383630/capsule_184x69.jpg?t=1436537417

SEEP Universe: http://www.seepuniverse.com/ (Sito ufficiale)

 

Blogging, dev log e vecchi progetti:

SEEP Blog: http://www.seeproduction.blogspot.ie/ (DOWNLOAD dei nostri progetti)

SEEP Bar: http://seepbar.blogspot.it/ (il bar viruale dove parlare di retrogaming e giochi indie)

Link to comment
Share on other sites

#==============================================================================# ** Auto Font Install#------------------------------------------------------------------------------# Wachunga Tradotto da:# Version 1.1 Andre4e# 2006-05-26#------------------------------------------------------------------------------=begin Italiano Questo script installa automaticamente i font!Istruzioni:1)Creare una cartella all'interno della cartella delgioco chiamata (Vedi Module fonts), se non è statacambiata la cartella si deve chiamare Fonts2)all'interno della cartella Fonts,inserire i font che si desidera installare3)Andare alla riga 80 al Module Fonts e inserireil nome del font come richiesto4)Questo script per funzionare ha bisogno diun file chiamato "fileutils.rb" e che deve esssereinserito nella cartella data5) è compatibile con sdk. se si usa l'sdktogliere l'asterisco alle righe 69,74,162 EnglishAutomatically installs one or more fonts so the player doesn't have to. Itonly does this the first time the game is run and the process is quitetransparent (notification to the player is optional). Thanks to MagicMagor for the pointer to one of the Win32 functions. FEATURES- handles installation of fonts so players don't have to- supports multiple fonts- process is quite transparent SETUPCreate a Fonts folder in the game directory and place all fonts to beinstalled within. Then update the Filenames and Names constants below,adding an element to both arrays for each font. This script only installs the fonts on the player's computer. You'llstill have to refer to them as necessary within the game,e.g. by setting a new default as follows (in main):Font.default_name = [Fonts::Names[0], 'MS PGothic'] This script uses the SDK, available from:[url="http://www.rmxp.org/forums/showthread.php?t=1802"]http://www.rmxp.org/forums/showthread.php?t=1802[/url] (To remove this dependency, just delete the three SDK-labeled lines,including the 'end' at the bottom of the script.) This script also requires the free FileUtils module by Minero Aoki, whichis included in the standard Ruby distribution but for some reason notavailable in RMXP. Download and place it in your scripts subdirectory:[url="http://s88387243.onlinehome.us/rmxp/auto_f...ll/fileutils.rb"]http://s88387243.onlinehome.us/rmxp/auto_f...ll/fileutils.rb[/url] Note: if player does not have the rights to install fonts on their machine,this probably won't work -- but then they wouldn't be able to do it manuallyeither. :) =end #------------------------------------------------------------------------------# * SDK Log Script#------------------------------------------------------------------------------#SDK.log('Auto Font Install', 'Wachunga', 1.1, '2006-05-26') #------------------------------------------------------------------------------# * Begin SDK Enabled Check#------------------------------------------------------------------------------#if SDK.state('Auto Font Install') == true     module Fonts# Nome dei font che devo essere installati# Inserire anche l'estensioneFilenames = ['Harrington.TTF','OLDENGL.TTF'] # Nome dei font, non dei file.# Per visualizzare il nome del font, fare doppio# clic su essoNames = ['Harrington','Old English Text MT'] # True = Visualizza messaggio di installazione# false = Non lo visualizzaNotify = true # Cartella contenente i font da installare# La cartella deve essere all'interno della# cartella del giocoSource = 'Fonts/' # Cartella dove installare i font# Non modifcareDest = ENV['SystemRoot'] + '\Fonts\\'end class Scene_Title AFR = Win32API.new('gdi32', 'AddFontResource', ['P'], 'L')WPS = Win32API.new('kernel32', 'WriteProfileString', ['P'] * 3, 'L')SM = Win32API.new('user32', 'SendMessage', ['L'] * 4, 'L')WM_FONTCHANGE = 0x001DHWND_BROADCAST = 0xffff alias wachunga_autofontinstall_st_main maindef mainsuccess = []for i in 0...Fonts::Filenames.sizef = Fonts::Filenames[i]# check if already installed...if not FileTest.exists?(Fonts::Dest + f)# check to ensure font is in specified location...if FileTest.exists?(Fonts::Source + f)require Dir.getwd + '/Data/fileutils.rb'# copy file to fonts folderFileUtils.cp(Fonts::Source + f, Fonts::Dest + f)# add font resourceAFR.call(Fonts::Dest + f)# add entry to win.ini/registryWPS.call('Fonts', Fonts::Names[i] + ' (TrueType)', f)SM.call(HWND_BROADCAST,WM_FONTCHANGE,0,0)if FileTest.exists?(Fonts::Dest + f)success.push(Fonts::Names[i])elseprint "Istallazione automaticadel font:\n\n è fallita l'istallazine del font " +Fonts::Names[i] + '.'endelseprint "Istallazione automatica del fontl:\n\n il font " + f + " non è stato trovato."endendendif success != [] # one or more fonts successfully installedif Fonts::Notifyfonts = ''success.each do |f|fonts << f << ', 'endprint " Istallazione automatica del font\n\n è stato istallato corretamente il font " + fonts[0..-3] +'.'end# new fonts aren't recognized in RMXP until the program is# restarted, so this is (unfortunately) necessarya = Thread.new { system('Game') }exitendwachunga_autofontinstall_st_mainend end #------------------------------------------------------------------------------# * End SDK Enable Test#------------------------------------------------------------------------------#end

 

 

 

Se permetti Andre questa qui sopra è la traduzine italiana dello script.

Al giocatore non appariranno scritte inglesi XP

Per qualsiasi motivo non aprite questo spoiler.

 

 

Ho detto di non aprirlo !

 

 

Se lo apri ancora esplode il mondo.

 

 

Aaaaaa è un vizio.

 

 

Contento? Il mondo è esploso, sono tutti morti

per colpa della tua curiosità .

 

 

Vuoi che ti venga anche il morbillo, la varicella e l'AIDS???

 

 

O bravo ora sei un malato terminale e nessuno

ti puo curare, sono tutti morti !

 

 

Se clicchi ancora una volta il PC esplode.

 

 

E dai smettila !!

 

Uff!! Hai cliccato tante volte che ho dovuto sostituirlo con un codebox.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

http://s8.postimg.org/yntv9nxld/Banner.png

http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif

Link to comment
Share on other sites

  • 1 month later...

Salve,

indubbiamente questo script è molto utile,

ma io nella cartella "Data" non trovo nessun "fileutils.rb"...

come posso fare? :smile:

 

Grazie per l'interessamento...

Edited by BIN.AD. corporation™
BIN.AD. corporation™ All rights ® reservedVisita il sito http://binadcorporation.jimdo.comVedrai, ti catturerà!!!
Link to comment
Share on other sites

Credo che intenda nella cartella "Data" della demo che puoi scaricare nel primo post ;)

"Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."

Making is not dead. You are dead.
RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna

http://i.imgur.com/cFgc2lW.png

Prova Standrama!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...