Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version = "1.0"
- local fontLoaderVersion = 1
- fs.makeDir( "fonts" )
- local function addFont( name, text )
- local sName = "fonts/" ..name
- fs.delete( sName )
- file = fs.open( sName, "w" )
- file.write( text )
- file.close()
- end
- addFont( "f4!1", [[48(d3f9h!jk1mn0pqr57uvwxy2
- 48(d3f9h!jk1mn0pqr57uvwxy2]] )
- if usedThisProgramAgainYeaLolNoobHahaStopLookingAtThisCodeActuallyNVMiDontCareAnymoreDoWhateverYouWant == nil then
- usedThisProgramAgainYeaLolNoobHahaStopLookingAtThisCodeActuallyNVMiDontCareAnymoreDoWhateverYouWant = true
- oldWrite = term.write
- end
- _cMCHARS = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }
- _lMCHARS = { }
- for i=1,#_cMCHARS do
- table.insert( _lMCHARS, string.upper( _cMCHARS[ i ] ) )
- end
- function loadFont( path, sType )
- if sType == nil then
- sType = fontLoaderVersion
- end
- if sType == 1 then
- if fs.exists( path ) then
- local chars = _cMCHARS
- local file = fs.open( path, "r" )
- if file then
- local sLower = file.readLine()
- local sCaps = file.readLine()
- _cMCHARS = {}
- _lMCHARS = {}
- for i=1,#sLower do
- local currentChar = string.sub( sLower, i, i )
- table.insert( _cMCHARS, currentChar )
- end
- for i=1,#sCaps do
- local currentChar = string.sub( sCaps, i, i )
- table.insert( _lMCHARS, currentChar )
- end
- file.close()
- return true
- end
- end
- else
- error("Invalid Font Version")
- end
- return false
- end
- local function isCaps( char )
- if string.upper( char ) == char then
- return true
- end
- return false
- end
- local function getSpecial( char )
- local tNums = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }
- local tChar = string.lower( char )
- local tValue = 0
- for i=1,#tNums do
- if tNums[ i ] == tChar then
- if isCaps( char ) then
- return _lMCHARS[ i ]
- else
- return _cMCHARS[ i ]
- end
- end
- end
- return char
- end
- term.write = function( text )
- local sText = ""
- for i=1,#text do
- local sChar = string.sub( text, i, i )
- sText = sText.. getSpecial( sChar )
- end
- return oldWrite( sText )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement