Android Open Source - TweeningTextView Svg Glyph






From Project

Back to project page TweeningTextView.

License

The source code is released under:

Apache License

If you think the Android project TweeningTextView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.kokalabs.svg;
//from  w  ww  . jav a2s.co  m
import com.google.common.collect.Lists;

import java.util.List;

public abstract class SvgGlyph {
    public static SvgGlyph from(final List<CubicBezierCurve> path) {
        return new SvgGlyph() {
            @Override
            public List<CubicBezierCurve> getPath() {
                return path;
            }
        };
    }

    public static SvgGlyph from(final String pathDescriptions, final double unitsPerEm) {
        return new SvgGlyph() {
            List<CubicBezierCurve> cached;

            @Override
            public List<CubicBezierCurve> getPath() {
                if (cached == null) {
                    SvgCommandAsCubicHandler toCubicBezierCurve = new SvgCommandAsCubicHandler();
                    new SvgGlyphParser(pathDescriptions).parseUsing(toCubicBezierCurve);
                    cached = Lists.newArrayList();
                    for (CubicBezierCurve c : toCubicBezierCurve.getPathAsCubicBezierCurves()) {
                        cached.add(c.normalizeWithMax(unitsPerEm * 2).flipAlongHorizontal());
                    }
                }
                return cached;
            }
        };
    }


    public static SvgGlyph origin() {
        return SvgGlyph.from(Lists.newArrayList(CubicBezierCurve.origin()));
    }

    public abstract List<CubicBezierCurve> getPath();
}




Java Source Code List

com.kokalabs.svg.CubicBezierCurve.java
com.kokalabs.svg.PointD.java
com.kokalabs.svg.SvgCommandAsCubicHandler.java
com.kokalabs.svg.SvgCommandHandler.java
com.kokalabs.svg.SvgGlyphParser.java
com.kokalabs.svg.SvgGlyphTweenViaInterpolation.java
com.kokalabs.svg.SvgGlyph.java
com.kokalabs.tweening.textview.TweeningTextView.java
com.kokalabs.tweening.textview.example.ApplicationTest.java
com.kokalabs.tweening.textview.example.Char.java
com.kokalabs.tweening.textview.example.TweeningActivity.java