static TextLabel() { }
+ static private string defaultFontFamily = "TizenSans";
+ private string fontFamily = defaultFontFamily;
+ private bool hasSystemFontTypeChanged = false;
private string textLabelSid = null;
private bool systemlangTextFlag = false;
private TextLabelSelectorData selectorData;
}
}
+ private bool HasStyle()
+ {
+ return ThemeManager.GetStyle(this.GetType()) == null ? false : true;
+ }
+
/// <summary>
/// The TranslatableText property.<br />
/// The text can set the SID value.<br />
}
}
+ private string InternalFontFamily
+ {
+ get
+ {
+ if (HasStyle())
+ return fontFamily;
+ else
+ return Object.InternalGetPropertyString(this.SwigCPtr, TextLabel.Property.FontFamily);
+ }
+ set
+ {
+ string newFontFamily;
+
+ if (string.Equals(fontFamily, value)) return;
+
+ fontFamily = value;
+ if (fontFamily == Tizen.NUI.FontFamily.UseSystemSetting)
+ {
+ try
+ {
+ newFontFamily = SystemSettings.FontType;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Exception caught.", e);
+ newFontFamily = defaultFontFamily;
+ }
+ AddSystemSettingsFontTypeChanged();
+ }
+ else
+ {
+ newFontFamily = fontFamily;
+ RemoveSystemSettingsFontTypeChanged();
+ }
+
+ SetInternalFontFamily(newFontFamily);
+ }
+ }
+
+ private void SetInternalFontFamily(string fontFamily)
+ {
+ Object.InternalSetPropertyString(this.SwigCPtr, TextLabel.Property.FontFamily, (string)fontFamily);
+ RequestLayout();
+ }
+
/// <summary>
/// The FontStyle property.<br />
/// The requested font style to use.<br />
SystemSettings.LocaleLanguageChanged -= SystemSettings_LocaleLanguageChanged;
}
+ RemoveSystemSettingsFontTypeChanged();
+
removeFontSizeChangedCallback();
if (type == DisposeTypes.Explicit)
}
}
+ private void SystemSettingsFontTypeChanged(object sender, FontTypeChangedEventArgs e)
+ {
+ SetInternalFontFamily(e.Value);
+ }
+
+ private void AddSystemSettingsFontTypeChanged()
+ {
+ if (HasStyle() && !hasSystemFontTypeChanged)
+ {
+ try
+ {
+ SystemSettings.FontTypeChanged += SystemSettingsFontTypeChanged;
+ hasSystemFontTypeChanged = true;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Exception caught.", e);
+ hasSystemFontTypeChanged = false;
+ }
+ }
+ }
+
+ private void RemoveSystemSettingsFontTypeChanged()
+ {
+ if (hasSystemFontTypeChanged)
+ {
+ try
+ {
+ SystemSettings.FontTypeChanged -= SystemSettingsFontTypeChanged;
+ hasSystemFontTypeChanged = false;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Exception caught.", e);
+ hasSystemFontTypeChanged = true;
+ }
+ }
+ }
+
private void RequestLayout()
{
Layout?.RequestLayout();