コード例 #1
0
        /// <summary>
        /// set the font by specifying an index (the index int the AvailableFonts)
        /// </summary>
        /// <param name="index">Index.</param>
        private void SetFontByIndex(int index)
        {
            List <string> availableFonts = VTextInterface.GetAvailableFonts();

            _currentFontIndex = index;

            if (index < 0)
            {
                _currentFontIndex = availableFonts.Count - 1;
            }

            if (index >= availableFonts.Count)
            {
                _currentFontIndex = 0;
            }

            VTextController.SetFont(availableFonts[_currentFontIndex]);
        }
コード例 #2
0
 /// <summary>
 /// this is called if the current used fontname changes
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 void OnFontNameChanged(object sender, GenericEventArgs <string> e)
 {
     _currentFontIndex  = VTextInterface.GetAvailableFonts().IndexOf(e.Value);
     FontNameLabel.text = string.Format("{0} ({1}/{2})", e.Value, _currentFontIndex + 1, VTextInterface.GetAvailableFonts().Count);
 }