Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
iesika

Pseudo big font library

Recommended Posts

I want to change font size in opencomputers screen, but It seems that API does not exist.

So, I made this.

  • You can use range of characters from 0x0020 to 0x007E.
  • You can change font size (2-8). I recommend that you use size 4 or 8.

Download:

attachment file or github

API:

bigfont.load(size: number) -- load font file

bigfont.set(x: number, y: number, string: number, size: number) -- writes a string to the screen

Example:

local bigfont = require("bigfont")
local component = require("component")
local gpu = component.gpu
local w, h = gpu.getResolution()
local args = {...}

gpu.fill(1,1,w,h," ")

for size = 2, 8 do
    bigfont.load(size)
end

local y = 1

for size = 2, 8 do
    bigfont.set(1, y, args[1] or "size"..tostring(size), size)
    y = y + size
end

 

2016-09-16_00.29.38.png?raw=true2016-09-15_23.13.33.png?raw=true

 

(sorry for my English)

 

bigfont.zip

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.