Пример #1
0
    public static TextFontInfo GetIndicateOfflineModeMessageText()
    {
        int          idx = GetCurrentLanguageIndex();
        TextFontInfo tfi = new TextFontInfo(INDICATE_OFFLINE_MODE_MESSAGE[idx], MAIN_MENU_TITLE_FONT[idx], MAIN_MENU_TITLE_FONTSIZE[idx]);

        return(tfi);
    }
Пример #2
0
    public static TextFontInfo GetMainMenuTitleText()
    {
        int          idx = GetCurrentLanguageIndex();
        TextFontInfo tfi = new TextFontInfo(MAIN_MENU_TITLE[idx], MAIN_MENU_TITLE_FONT[idx], MAIN_MENU_TITLE_FONTSIZE[idx]);

        return(tfi);
    }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_PSD();

            //ExStart:GetPropertiesOfInlineFormattingOfTextLayer
            using (var psdImage = (PsdImage)Image.Load(dataDir + "inline_formatting.psd"))
            {
                List <ITextPortion> regularText = new List <ITextPortion>();
                List <ITextPortion> boldText    = new List <ITextPortion>();
                List <ITextPortion> italicText  = new List <ITextPortion>();
                var layers = psdImage.Layers;
                for (int index = 0; index < layers.Length; index++)
                {
                    var layer = layers[index];
                    if (!(layer is TextLayer))
                    {
                        continue;
                    }

                    var textLayer = (TextLayer)layer;
                    // gets fonts that contains in text layer
                    var fonts        = textLayer.GetFonts();
                    var textPortions = textLayer.TextData.Items;

                    foreach (var textPortion in textPortions)
                    {
                        TextFontInfo font = fonts[textPortion.Style.FontIndex];
                        if (font != null)
                        {
                            switch (font.Style)
                            {
                            case FontStyle.Regular:
                                regularText.Add(textPortion);
                                break;

                            case FontStyle.Bold:
                                boldText.Add(textPortion);
                                break;

                            case FontStyle.Italic:
                                italicText.Add(textPortion);
                                break;

                            default:
                                throw new ArgumentOutOfRangeException();
                            }
                        }
                    }
                }
            }

            //ExEnd:GetPropertiesOfInlineFormattingOfTextLayer
        }
Пример #4
0
    private void Awake()
    {
        // Font 설정
        //mainMenuTitleUI.text = Properties.GetMainMenuTitle();
        //mainMenuTitleUI.font = (Font)Resources.Load((string)Properties.GetMainMenuTitleFont());
        //mainMenuTitleUI.fontSize = Properties.GetMainMenuTitleFontSize();

        TextFontInfo tfi = Properties.GetMainMenuTitleText();

        mainMenuTitleUI.text     = tfi.Text;
        mainMenuTitleUI.font     = tfi.Font;
        mainMenuTitleUI.fontSize = tfi.FontSize;
    }