Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove FontStyle: Display #2452

Merged
merged 8 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 0 additions & 15 deletions samples/HostConfig/microsoft-teams.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 600
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Segoe UI Mono",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/outlook-desktop.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 600
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Courier New",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 600
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Segoe UI Mono",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/sampleDifferentFont.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 600
}
},
"display": {
"fontFamily": "Comic Sans",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Courier New",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/skype.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 600
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 600
}
},
"monospace": {
"fontFamily": "Segoe UI Mono",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/windows-notification.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@
"bolder": 700
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 15,
"medium": 20,
"large": 24,
"extraLarge": 34
},
"fontWeights": {
"lighter": 400,
"default": 500,
"bolder": 700
}
},
"monospace": {
"fontFamily": "Segoe UI Mono",
"fontSizes": {
Expand Down
15 changes: 0 additions & 15 deletions samples/HostConfig/windows-timeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
"bolder": 700
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 20,
"large": 20,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 700
}
},
"monospace": {
"fontFamily": "Segoe UI Mono",
"fontSizes": {
Expand Down
5 changes: 0 additions & 5 deletions samples/v1.2/Elements/TextBlock.FontStyles.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
"text": "Font style set to *default*.",
"fontStyle": "default"
},
{
"type": "TextBlock",
"text": "Font style set to *display*.",
"fontStyle": "display"
},
{
"type": "TextBlock",
"text": "Font style set to *monospace*.",
Expand Down
29 changes: 0 additions & 29 deletions source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18470,35 +18470,6 @@ SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectMod
}


SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_FontStylesDefinition_1displayStyle_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
AdaptiveCards::FontStylesDefinition *arg1 = (AdaptiveCards::FontStylesDefinition *) 0 ;
AdaptiveCards::FontStyleDefinition *arg2 = (AdaptiveCards::FontStyleDefinition *) 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(AdaptiveCards::FontStylesDefinition **)&jarg1;
arg2 = *(AdaptiveCards::FontStyleDefinition **)&jarg2;
if (arg1) (arg1)->displayStyle = *arg2;
}


SWIGEXPORT jlong JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_FontStylesDefinition_1displayStyle_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
AdaptiveCards::FontStylesDefinition *arg1 = (AdaptiveCards::FontStylesDefinition *) 0 ;
AdaptiveCards::FontStyleDefinition *result = 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(AdaptiveCards::FontStylesDefinition **)&jarg1;
result = (AdaptiveCards::FontStyleDefinition *)& ((arg1)->displayStyle);
*(AdaptiveCards::FontStyleDefinition **)&jresult = result;
return jresult;
}


SWIGEXPORT void JNICALL Java_io_adaptivecards_objectmodel_AdaptiveCardObjectModelJNI_FontStylesDefinition_1monospaceStyle_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
AdaptiveCards::FontStylesDefinition *arg1 = (AdaptiveCards::FontStylesDefinition *) 0 ;
AdaptiveCards::FontStyleDefinition *arg2 = (AdaptiveCards::FontStyleDefinition *) 0 ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,6 @@ public class AdaptiveCardObjectModelJNI {
public final static native void delete_FontStyleDefinition(long jarg1);
public final static native void FontStylesDefinition_defaultStyle_set(long jarg1, FontStylesDefinition jarg1_, long jarg2, FontStyleDefinition jarg2_);
public final static native long FontStylesDefinition_defaultStyle_get(long jarg1, FontStylesDefinition jarg1_);
public final static native void FontStylesDefinition_displayStyle_set(long jarg1, FontStylesDefinition jarg1_, long jarg2, FontStyleDefinition jarg2_);
public final static native long FontStylesDefinition_displayStyle_get(long jarg1, FontStylesDefinition jarg1_);
public final static native void FontStylesDefinition_monospaceStyle_set(long jarg1, FontStylesDefinition jarg1_, long jarg2, FontStyleDefinition jarg2_);
public final static native long FontStylesDefinition_monospaceStyle_get(long jarg1, FontStylesDefinition jarg1_);
public final static native long FontStylesDefinition_Deserialize(long jarg1, JsonValue jarg1_, long jarg2, FontStylesDefinition jarg2_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public enum AdaptiveCardSchemaKey {
DateInput,
Default,
DefaultPoster,
Display,
ElementId,
Emphasis,
ExtraLarge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

public enum FontStyle {
Default(0),
Display,
Monospace;

public final int swigValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ public FontStyleDefinition getDefaultStyle() {
return (cPtr == 0) ? null : new FontStyleDefinition(cPtr, false);
}

public void setDisplayStyle(FontStyleDefinition value) {
AdaptiveCardObjectModelJNI.FontStylesDefinition_displayStyle_set(swigCPtr, this, FontStyleDefinition.getCPtr(value), value);
}

public FontStyleDefinition getDisplayStyle() {
long cPtr = AdaptiveCardObjectModelJNI.FontStylesDefinition_displayStyle_get(swigCPtr, this);
return (cPtr == 0) ? null : new FontStyleDefinition(cPtr, false);
}

public void setMonospaceStyle(FontStyleDefinition value) {
AdaptiveCardObjectModelJNI.FontStylesDefinition_monospaceStyle_set(swigCPtr, this, FontStyleDefinition.getCPtr(value), value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.adaptivecards.renderer.RenderedAdaptiveCard;
import io.adaptivecards.renderer.actionhandler.ICardActionHandler;
import io.adaptivecards.objectmodel.BaseCardElement;
import io.adaptivecards.objectmodel.FontSizesConfig;
import io.adaptivecards.objectmodel.HorizontalAlignment;
import io.adaptivecards.objectmodel.HostConfig;
import io.adaptivecards.objectmodel.TextBlock;
Expand Down
7 changes: 1 addition & 6 deletions source/dotnet/Library/AdaptiveCards/AdaptiveFontStyle.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Newtonsoft.Json;

namespace AdaptiveCards
Expand All @@ -14,11 +14,6 @@ public enum AdaptiveFontStyle
/// </summary>
Default,

/// <summary>
/// An alternative font style for text
/// </summary>
Display,

/// <summary>
/// The monospace font style
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,17 @@ public string GetFontFamily(AdaptiveFontStyle fontStyle)
{
if (fontStyle == AdaptiveFontStyle.Monospace)
{
fontFamilyValue = GetDefaultFontFamily(fontStyle);
fontFamilyValue = GetDefaultFontFamily(fontStyle);
}
else
{
// Fallback to default fontStyle value
fontFamilyValue = FontStyles.Default.FontFamily;
if (string.IsNullOrEmpty(fontFamilyValue))
{
// Fallback to deprecated fontFamily value
fontFamilyValue = FontFamily;
if (string.IsNullOrEmpty(fontFamilyValue))
{
// Fallback to predefined system default value
fontFamilyValue = GetDefaultFontFamily(fontStyle);
}
}
// Fallback to deprecated fontFamily value
fontFamilyValue = FontFamily;
if (string.IsNullOrEmpty(fontFamilyValue))
{
// Fallback to predefined system default value
fontFamilyValue = GetDefaultFontFamily(fontStyle);
}
}
}
return fontFamilyValue;
Expand Down Expand Up @@ -215,7 +210,6 @@ private string GetDefaultFontFamily(AdaptiveFontStyle fontStyle)
{
case AdaptiveFontStyle.Monospace:
return "Courier New";
case AdaptiveFontStyle.Display:
case AdaptiveFontStyle.Default:
default:
// Leave it up to the platform.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace AdaptiveCards.Rendering
Expand All @@ -9,18 +9,13 @@ public class FontStylesConfig
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public FontStyleConfig Default { get; set; } = new FontStyleConfig();

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public FontStyleConfig Display { get; set; } = new FontStyleConfig();

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public FontStyleConfig Monospace { get; set; } = new FontStyleConfig();

public FontStyleConfig GetFontStyle(AdaptiveFontStyle fontStyle)
{
switch (fontStyle)
{
case AdaptiveFontStyle.Display:
return Display;
case AdaptiveFontStyle.Monospace:
return Monospace;
case AdaptiveFontStyle.Default:
Expand Down
15 changes: 0 additions & 15 deletions source/ios/AdaptiveCards/ADCIOSVisualizer/resources/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
"bolder": 700
}
},
"display": {
"fontFamily": "Times New Roman",
"fontSizes": {
"small": 12,
"default": 14,
"medium": 17,
"large": 21,
"extraLarge": 26
},
"fontWeights": {
"lighter": 200,
"default": 400,
"bolder": 700
}
},
"monospace": {
"fontFamily": "Courier New",
"fontSizes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ - (instancetype)initWithConfig:(std::shared_ptr<HostConfig> const &)config

// check if requested font family name is supported by iOS, if so save it for future uses
[self importFontFamily: AdaptiveCards::FontStyle::Default];
[self importFontFamily: AdaptiveCards::FontStyle::Display];
[self importFontFamily: AdaptiveCards::FontStyle::Monospace];

_allActionsHaveIcons = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace AdaptiveCardsSharedModelUnitTest
ENUM_TEST(ForegroundColor, ForegroundColor::Accent, "Accent"s);
ENUM_TEST_WITH_REVERSE_MAP(TextWeight, TextWeight::Bolder, "Bolder"s, {{"Normal", TextWeight::Default}});
ENUM_TEST_WITH_REVERSE_MAP(TextSize, TextSize::Large, "Large"s, {{"Normal", TextSize::Default}});
ENUM_TEST(FontStyle, FontStyle::Display, "Display"s);
ENUM_TEST(FontStyle, FontStyle::Monospace, "Monospace"s);
ENUM_TEST_WITH_DEFAULT(ActionsOrientation, ActionsOrientation::Vertical, "Vertical"s, ActionsOrientation::Horizontal);
ENUM_TEST_WITH_DEFAULT(ActionMode, ActionMode::Popup, "Popup"s, ActionMode::Inline);
ENUM_TEST_WITH_DEFAULT(ChoiceSetStyle, ChoiceSetStyle::Expanded, "Expanded"s, ChoiceSetStyle::Compact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ namespace AdaptiveCardsSharedModelUnitTest
auto textBlockItem = std::static_pointer_cast<TextBlock>(items.at(1));
Assert::AreEqual("Column3_TextBlock_text"s, textBlockItem->GetText());
Assert::AreEqual("Column3_TextBlock_id"s, textBlockItem->GetId());
Assert::IsTrue(FontStyle::Display == textBlockItem->GetFontStyle());
}
}

Expand Down
Loading