Beispiel #1
0
        // TODO: Good to expose FontUtil.h.
        public bool analyzeStyle(MinikinFont typeface, ref int weight, ref bool italic)
        {
            std::lock_guard <std::recursive_mutex> _l = new std::lock_guard <std::recursive_mutex>(gMinikinLock);
            uint   os2Tag   = MinikinFont.MakeTag('O', 'S', '/', '2');
            HbBlob os2Table = new HbBlob(getFontTable(typeface.get(), new uint(os2Tag)));

            if (os2Table.get() == null)
            {
                return(false);
            }
            return(global::minikin.analyzeStyle(os2Table.get(), os2Table.size(), weight, italic));
        }
Beispiel #2
0
        //C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
        //ORIGINAL LINE: ClassicUnorderedSet<AxisTag> getSupportedAxesLocked() const;
        public HashSet <AxisTag> getSupportedAxesLocked()
        {
            uint   fvarTag   = MinikinFont.MakeTag('f', 'v', 'a', 'r');
            HbBlob fvarTable = new HbBlob(getFontTable(typeface.get(), new uint(fvarTag)));

            if (fvarTable.size() == 0)
            {
                return(new HashSet <AxisTag>());
            }

            HashSet <AxisTag> supportedAxes = new HashSet <AxisTag>();

            analyzeAxes(fvarTable.get(), fvarTable.size(), supportedAxes);
            return(supportedAxes);
        }
Beispiel #3
0
        public void computeCoverage()
        {
            std::lock_guard <std::recursive_mutex> _l = new std::lock_guard <std::recursive_mutex>(gMinikinLock);
            FontStyle   defaultStyle = new FontStyle();
            MinikinFont typeface     = getClosestMatch(defaultStyle).font;
            uint        cmapTag      = MinikinFont.MakeTag('c', 'm', 'a', 'p');
            HbBlob      cmapTable    = new HbBlob(getFontTable(typeface, new uint(cmapTag)));

            if (cmapTable.get() == null)
            {
                ALOGE("Could not get cmap table size!\n");
                return;
            }
            mCoverage = CmapCoverage.getCoverage(cmapTable.get(), cmapTable.size(), mHasVSTable);

            for (int i = 0; i < mFonts.size(); ++i)
            {
                HashSet <AxisTag> supportedAxes = mFonts[i].getSupportedAxesLocked();
                mSupportedAxes.insert(supportedAxes.GetEnumerator(), supportedAxes.end());
            }
        }
Beispiel #4
0
 //C++ TO C# CONVERTER TODO TASK: 'rvalue references' have no equivalent in C#:
 public Font(MinikinFont typeface, FontStyle style)
 {
     this.typeface = typeface;
     this.style    = style;
 }