Experimental typesetting system

ETS Experimental typesetting system

This software repository contains a Lua frontend for the typesetting library “Boxes and Glue” which is an algorithmic typesetting machine in the spirits of TeX.

Build

You just need Go installed on your system, clone the repository and run

go build -o bin/ets github.com/speedata/ets/ets/ets

Running the software

call

bin/ets myscript.lua

on the command line

Status

This software is more or less a demo of the architecture and usable for any serious purpose yet.

Feedback welcome!

Contact and information

License: AGPL v3
Contact: Patrick Gundlach [email protected]

Sample code

-- The document d is the central point for all
function CreateFontVlist(d)
    local face, msg = d.loadFace("fonts/CrimsonPro-Regular.ttf")
    if not face then
        print(msg)
        os.exit(-1)
    end
    local fnt = d.createFont(face,document.sp("12pt"))

    local lang_en, msg = d.loadpattern("hyphenationpatterns/hyph-en-us.pat.txt")
    if not lang_en then
        print(msg)
        os.exit(-1)
    end

    lang_en.name = "en"

    local lang = node.new("lang")
    lang.lang = lang_en

    local tbl = fnt.shape("the quick brown fox jumps over the lazy dog")


    local head, cur = lang, lang
    for _, glyph in ipairs(tbl) do
        if glyph.glyph == 32 then
            local glu = node.new("glue")
            glu.width = fnt.space
            head = node.insertafter(head,cur,glu)
            cur = glu
        else
            local g = node.new("glyph")
            g.width = glyph.advance
            g.codepoint = glyph.codepoint
            g.font = glyph.font
            head = node.insertafter(head,cur,g)
            cur = g
        end
    end

    local hlist = node.hpack(head)

    local param = {
        hsize = document.sp("200pt"),
        lineheight = document.sp("12pt"),
    }

    local vl = node.simplelinebreak(hlist,param)
    return vl
end

local function CreateImageVlist(d)
    local imgfile = d.loadimagefile("img/ocean.pdf")
    local image = d.createimage(imgfile)


    local imagenode = node.new("image")
    imagenode.img = image
    imagenode.width = document.sp("4cm")
    imagenode.height = document.sp("3cm")
    local vlist = node.new("vlist")
    vlist.list = imagenode
    return vlist
end


local d = document.new("out.pdf")

local fontVL = CreateFontVlist(d)
local imageVL = CreateImageVlist(d)

d.outputat(document.sp("4cm"),document.sp("27cm"),fontVL)
d.outputat(document.sp("4cm"),document.sp("26cm"),imageVL)
d.currentpage().shipout()


local ok, msg = d.finish()
if not ok then
    print(msg)
    os.exit(-1)
end
Owner
Similar Resources

GeeseFS is a high-performance, POSIX-ish S3 (Yandex, Amazon) file system written in Go

GeeseFS is a high-performance, POSIX-ish S3 (Yandex, Amazon) file system written in Go

GeeseFS is a high-performance, POSIX-ish S3 (Yandex, Amazon) file system written in Go Overview GeeseFS allows you to mount an S3 bucket as a file sys

Jan 1, 2023

Go-lang based sonos standup system

Overview This is an CLI tool that can handle timed standup playback on a sonos device. It allows you to add links to audio files that will be randomly

Nov 23, 2021

Encrypted File System in Go

Getting Started: Setup the environment: Install GoLang: $ sudo apt update $ sudo apt upgrade $ sudo apt install libssl-dev gcc pkg-config $ sudo apt

Apr 30, 2022

A rudimentary go program that allows you to mount a mongo database as a FUSE file system

This is a rudimentary go program that allows you to mount a mongo database as a

Dec 29, 2021

Gokrazy mkfs: a program to create an ext4 file system on the gokrazy perm partition

gokrazy mkfs This program is intended to be run on gokrazy only, where it will c

Dec 12, 2022

Experimental system call tracer for Linux x86-64, written in Go

gtrace A system call tracer for Linux x86-64. DISCLAIMER: This software is experimental and not considered stable. Do not use it in mission-critical e

Nov 29, 2022

Lithia is an experimental functional programming language with an implicit but strong and dynamic type system.

Lithia is an experimental functional programming language with an implicit but strong and dynamic type system. Lithia is designed around a few core concepts in mind all language features contribute to.

Dec 24, 2022

An experimental library for building clustered services in Go

Donut is a library for building clustered applications in Go. Example package main import ( "context" "log" "os" // Wait for etcd client v3.4, t

Nov 17, 2022

Conception was an experimental project, looking for ways to make software development more efficient.

Conception was an experimental project, looking for ways to make software development more efficient.

Conception Note: All future development is done in the Go version. Conception is an experimental research project, meant to become a modern IDE/Langua

Jul 21, 2022

Experimental OpenAL bindings for Go.

Experimental OpenAL bindings for Go. ==================================== Everything is evolving quickly and nothing is totally done. If you want to

Jul 24, 2022

An experimental Go cross platform UI library.

GXUI - A Go cross platform UI library. Notice: Unfortunately due to a shortage of hours in a day, GXUI is no longer maintained. If you're looking for

Jan 6, 2023

Suite of libraries for IoT devices (written in Go), experimental for x/exp/io

Go libraries/drivers for IoT devices This repo contains a suite of libraries for IoT devices/sensors/actuators. The suite is meant to be as dependency

Sep 26, 2022

An experimental go FTP server framework

graval Go FTP server framework. By providing a simple driver class that responds to a handful of methods you can have a complete FTP server. Some samp

Sep 27, 2022

An experimental port of TinyRb to Google go, both as a means of learning go and exploring alternate approaches to implementing Ruby. Work is currently focused on the GoLightly VM.

tinyrb¶ ↑ A tiny subset of Ruby with a Lua'esc VM. Everything in TinyRb should run in the big Ruby. (except bugs and things that don't comply to the p

Sep 22, 2022

An experimental GraphQL implementation with Go.

Description An experimental GraphQL implementation with Go. This repo focuses on improve GraphQL Parse and Resolve speed t

Oct 11, 2022

Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Oct 11, 2022

An Experimental Wasm Virtual Machine for Gophers

gasm A minimal implementation of v1 WASM spec compatible virtual machine purely written in go. The vm can be embedded in your go program without any d

Dec 31, 2022

(Experimental) Go library for multi-platform clipboard.

clipboard This is a multi-platform clipboard library in Go. Abstract This is clipboard library in Go, which runs on multiple platforms. External clipb

Nov 20, 2022

LBADD: An experimental, distributed SQL database

LBADD: An experimental, distributed SQL database

LBADD Let's build a distributed database. LBADD is an experimental distributed SQL database, written in Go. The goal of this project is to build a dat

Nov 29, 2022
Comments
  • More permissive license

    More permissive license

    I am wondering if your organisation is willing to more to a more liberal license like AL 2.0, MIT, BSD?

    This project looks promising. Also following might be of interest: https://sile-typesetter.org, https://tectonic-typesetting.github.io/en-US/

Bigfile -- a file transfer system that supports http, rpc and ftp protocol https://bigfile.site
Bigfile -- a file transfer system that supports http, rpc and ftp protocol   https://bigfile.site

Bigfile ———— a file transfer system that supports http, rpc and ftp protocol 简体中文 ∙ English Bigfile is a file transfer system, supports http, ftp and

Dec 31, 2022
File system event notification library on steroids.

notify Filesystem event notification library on steroids. (under active development) Documentation godoc.org/github.com/rjeczalik/notify Installation

Dec 31, 2022
Pluggable, extensible virtual file system for Go

vfs Package vfs provides a pluggable, extensible, and opinionated set of file system functionality for Go across a number of file system types such as

Jan 3, 2023
Cross-platform file system notifications for Go.

File system notifications for Go fsnotify utilizes golang.org/x/sys rather than syscall from the standard library. Ensure you have the latest version

Jan 1, 2023
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).

中文 English 愿景:为用户提供最简单、可靠、高效的分布式文件系统。 go-fastdfs是一个基于http协议的分布式文件系统,它基于大道至简的设计理念,一切从简设计,使得它的运维及扩展变得更加简单,它具有高性能、高可靠、无中心、免维护等优点。 大家担心的是这么简单的文件系统,靠不靠谱,可不

Jan 8, 2023
Dragonfly is an intelligent P2P based image and file distribution system.
Dragonfly is an intelligent P2P based image and file distribution system.

Dragonfly Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in o

Jan 9, 2023
Plik is a scalable & friendly temporary file upload system ( wetransfer like ) in golang.

Want to chat with us ? Telegram channel : https://t.me/plik_root_gg Plik Plik is a scalable & friendly temporary file upload system ( wetransfer like

Jan 2, 2023
File system for GitHub
File system for GitHub

HUBFS · File System for GitHub HUBFS is a read-only file system for GitHub and Git. Git repositories and their contents are represented as regular dir

Dec 28, 2022
A virtual file system for small to medium sized datasets (MB or GB, not TB or PB). Like Docker, but for data.

AetherFS assists in the production, distribution, and replication of embedded databases and in-memory datasets. You can think of it like Docker, but f

Feb 9, 2022