All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.openhtmltopdf.bidi.support.ICUTransformers Maven / Gradle / Ivy

Go to download

Open HTML to PDF is a CSS 2.1 renderer written in Java. This artifact supports right-to-left text mixed with left-to-right text.

There is a newer version: 1.0.10
Show newest version
package com.openhtmltopdf.bidi.support;

import java.util.Locale;

import com.ibm.icu.lang.UCharacter;
import com.openhtmltopdf.extend.FSTextTransformer;

public class ICUTransformers {
	private ICUTransformers() { }
	
	public static class ICUToLowerTransformer implements FSTextTransformer {
		private final Locale lc;
		
		public ICUToLowerTransformer(Locale lc) {
			this.lc = lc;
		}
		
		@Override
		public String transform(String in) {
			return UCharacter.toLowerCase(lc, in);
		}
	}
	
	public static class ICUToUpperTransformer implements FSTextTransformer {
		private final Locale lc;
		
		public ICUToUpperTransformer(Locale lc) {
			this.lc = lc;
		}
		
		@Override
		public String transform(String in) {
			return UCharacter.toUpperCase(lc, in);
		}
	}
	
	public static class ICUToTitleTransformer implements FSTextTransformer {
		private final Locale lc;
		
		public ICUToTitleTransformer(Locale lc) {
			this.lc = lc;
		}
		
		@Override
		public String transform(String in) {
			return UCharacter.toTitleCase(lc, in, null, UCharacter.TITLECASE_NO_LOWERCASE);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy