// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperValidationException.java
// public class EPaperValidationException extends EPaperException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public EPaperValidationException(String message) {
// 		super(message);
// 	}
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/FontSize.java
// public enum FontSize {
// 	DOTS_32(32, 1), DOTS_48(48, 1), DOTS_64(64, 1);
// 
// 	private final int height;
// 
// 	private final int letterSpacing;
// 
// 	private FontSize(int height, int letterSpacing) {
// 		this.height = height;
// 		this.letterSpacing = letterSpacing;
// 	}
// 
// 	public int getHeight() {
// 		return height;
// 	}
// 
// 	public int getLetterSpacing() {
// 		return letterSpacing;
// 	}
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/HorizontalAlignment.java
// public enum HorizontalAlignment {
// 	LEFT, CENTER, RIGHT;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/VerticalAlignment.java
// public enum VerticalAlignment {
// 	TOP, CENTER, BOTTOM;
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import fr.romainmoreau.epaper.client.api.EPaperValidationException;
import fr.romainmoreau.epaper.client.api.FontSize;
import fr.romainmoreau.epaper.client.api.HorizontalAlignment;
import fr.romainmoreau.epaper.client.api.VerticalAlignment;
			Line line = new Line(width, fontSize);
			lines.add(line);
			for (String word : words) {
				boolean newLine = word.equals(LINE_FEED);
				if (newLine || !line.addWord(word)) {
					if (lines.size() == maxLines) {
						break;
					} else {
						line = new Line(width, fontSize);
						lines.add(line);
					}
					if (!newLine) {
						line.addWord(word);
					}
				}
			}
		}
		return lines;
	}

	public static void alignLines(int width, int height, int topLeftX, int topLeftY, FontSize fontSize, int spacing,
			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, List<Line> lines) {
		int linesHeight = lines.size() * (fontSize.getHeight() + spacing) - spacing;
		int y = topLeftY;
		switch (verticalAlignment) {
		case BOTTOM:
			y += height - linesHeight;
			break;
		case CENTER:
			y += (height - linesHeight) / 2;
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperValidationException.java
// public class EPaperValidationException extends EPaperException {
// 	private static final long serialVersionUID = 1L;
// 
// 	public EPaperValidationException(String message) {
// 		super(message);
// 	}
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/FontSize.java
// public enum FontSize {
// 	DOTS_32(32, 1), DOTS_48(48, 1), DOTS_64(64, 1);
// 
// 	private final int height;
// 
// 	private final int letterSpacing;
// 
// 	private FontSize(int height, int letterSpacing) {
// 		this.height = height;
// 		this.letterSpacing = letterSpacing;
// 	}
// 
// 	public int getHeight() {
// 		return height;
// 	}
// 
// 	public int getLetterSpacing() {
// 		return letterSpacing;
// 	}
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/HorizontalAlignment.java
// public enum HorizontalAlignment {
// 	LEFT, CENTER, RIGHT;
// }
// 
// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/VerticalAlignment.java
// public enum VerticalAlignment {
// 	TOP, CENTER, BOTTOM;
// }


// Path: e-paper-client-common/src/main/java/fr/romainmoreau/epaper/client/common/Lines.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import fr.romainmoreau.epaper.client.api.EPaperValidationException;
import fr.romainmoreau.epaper.client.api.FontSize;
import fr.romainmoreau.epaper.client.api.HorizontalAlignment;
import fr.romainmoreau.epaper.client.api.VerticalAlignment;

			Line line = new Line(width, fontSize);
			lines.add(line);
			for (String word : words) {
				boolean newLine = word.equals(LINE_FEED);
				if (newLine || !line.addWord(word)) {
					if (lines.size() == maxLines) {
						break;
					} else {
						line = new Line(width, fontSize);
						lines.add(line);
					}
					if (!newLine) {
						line.addWord(word);
					}
				}
			}
		}
		return lines;
	}

	public static void alignLines(int width, int height, int topLeftX, int topLeftY, FontSize fontSize, int spacing,
			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, List<Line> lines) {
		int linesHeight = lines.size() * (fontSize.getHeight() + spacing) - spacing;
		int y = topLeftY;
		switch (verticalAlignment) {
		case BOTTOM:
			y += height - linesHeight;
			break;
		case CENTER:
			y += (height - linesHeight) / 2;
			break;