package net.afterlifelochie.fontbox.document;

import java.io.IOException;

import net.afterlifelochie.fontbox.api.ITracer;
import net.afterlifelochie.fontbox.layout.LayoutException;
import net.afterlifelochie.fontbox.layout.PageWriter;
import net.afterlifelochie.fontbox.layout.components.Page;
import net.afterlifelochie.fontbox.render.BookGUI;

public class Heading extends Element {

	public String id;
	public String text;

	public Heading(String id, String text) {
		this.id = id;
		this.text = text;
	}

	@Override
	public void layout(ITracer trace, PageWriter writer) throws IOException, LayoutException {
		Page page = writer.current();
		boxText(trace, writer, page.properties.headingFont, text);
	}

	@Override
	public boolean canUpdate() {
		return false;
	}

	@Override
	public void update() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void render(BookGUI gui, int mx, int my, float frame) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void clicked(BookGUI gui, int mx, int my) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void typed(BookGUI gui, char val, int code) {
		// TODO Auto-generated method stub
		
	}

}

@@ -233,24 +233,85 @@
 ageWriter;%0D%0A
+import net.afterlifelochie.fontbox.layout.PageWriterCursor;%0D%0A
 import net.a
@@ -785,16 +785,81 @@
 text);%0D%0A
+%09%09PageWriterCursor cursor = writer.cursor();%0D%0A%09%09cursor.y += 10;%0D%0A
 %09%7D%0D%0A%0D%0A%09@

Fix Heading sitting on top of content (no trailing margin)