Mhurd has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/130237

Change subject: Defined WikiFont characters rather than pasting raw chars.
......................................................................

Defined WikiFont characters rather than pasting raw chars.

As Brion pointed out, the raw chars don't render in xCode so
they're hard to read.

The define names I used are based on the names from the names
from the WikiFont repo's font.css file.

Change-Id: Ic7515a61ebdb8bcc4111d18eb9f5118e88dc689c
---
M Wikipedia.xcodeproj/project.pbxproj
A wikipedia/Defines/WMF_WikiFont_Chars.h
M wikipedia/View Controllers/MainMenu/MainMenuViewController.m
M wikipedia/View Controllers/PageHistory/PageHistoryViewController.m
M wikipedia/View Controllers/TopNav/NavController.m
5 files changed, 190 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/37/130237/1

diff --git a/Wikipedia.xcodeproj/project.pbxproj 
b/Wikipedia.xcodeproj/project.pbxproj
index 1afeab0..cc51073 100644
--- a/Wikipedia.xcodeproj/project.pbxproj
+++ b/Wikipedia.xcodeproj/project.pbxproj
@@ -279,6 +279,7 @@
                0466F44E183A30CC00EA1FD7 /* logo-search-placehol...@2x.png */ = 
{isa = PBXFileReference; lastKnownFileType = image.png; path = 
"logo-search-placehol...@2x.png"; sourceTree = "<group>"; };
                04735E5E18A5B42D00C89C30 /* LoginTokenOp.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LoginTokenOp.h; sourceTree = "<group>"; };
                04735E5F18A5B42D00C89C30 /* LoginTokenOp.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= LoginTokenOp.m; sourceTree = "<group>"; };
+               047528A3190F0C2900F2CDA8 /* WMF_WikiFont_Chars.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
WMF_WikiFont_Chars.h; sourceTree = "<group>"; };
                0476967A18BBFC9400071963 /* AccountCreationOp.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
AccountCreationOp.h; sourceTree = "<group>"; };
                0476967B18BBFC9400071963 /* AccountCreationOp.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= AccountCreationOp.m; sourceTree = "<group>"; };
                047801BC18AE987900DBB747 /* UIButton+ColorMask.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"UIButton+ColorMask.h"; sourceTree = "<group>"; };
@@ -641,6 +642,7 @@
                        children = (
                                04292FFC185FC026002A13FC /* Defines.h */,
                                043F18F118DCDD3A00D8489A /* WMF_Colors.h */,
+                               047528A3190F0C2900F2CDA8 /* 
WMF_WikiFont_Chars.h */,
                        );
                        path = Defines;
                        sourceTree = "<group>";
diff --git a/wikipedia/Defines/WMF_WikiFont_Chars.h 
b/wikipedia/Defines/WMF_WikiFont_Chars.h
new file mode 100644
index 0000000..b2eebb7
--- /dev/null
+++ b/wikipedia/Defines/WMF_WikiFont_Chars.h
@@ -0,0 +1,161 @@
+
+/* UI ELEMENTS e000_023 */
+
+#define WIKIFONT_CHAR_MAGNIFYING_GLASS           @"\ue000"
+
+#define WIKIFONT_CHAR_ARROW_LEFT                 @"\ue001"
+
+#define WIKIFONT_CHAR_TICK                       @"\ue002"
+
+#define WIKIFONT_CHAR_X                          @"\ue003"
+
+#define WIKIFONT_CHAR_X_CIRCLE                   @"\ue004"
+
+#define WIKIFONT_CHAR_UNSTAR                     @"\ue005"
+
+#define WIKIFONT_CHAR_STAR                       @"\ue006"
+
+#define WIKIFONT_CHAR_SUN                        @"\ue007"
+
+#define WIKIFONT_CHAR_STAR_CIRCLE                @"\ue008"
+
+#define WIKIFONT_CHAR_FUNNEL                     @"\ue009"
+
+#define WIKIFONT_CHAR_EYE                        @"\ue010"
+
+#define WIKIFONT_CHAR_EYE_LID                    @"\ue011"
+
+#define WIKIFONT_CHAR_BOOKMARK                   @"\ue012"
+
+#define WIKIFONT_CHAR_PRINTER                    @"\ue013"
+
+#define WIKIFONT_CHAR_PUZZLE                     @"\ue014"
+
+#define WIKIFONT_CHAR_CLOCK                      @"\ue015"
+
+#define WIKIFONT_CHAR_DICE                       @"\ue016"
+
+#define WIKIFONT_CHAR_MOVE                       @"\ue017"
+
+#define WIKIFONT_CHAR_GEAR                       @"\ue018"
+
+#define WIKIFONT_CHAR_ELLIPSIS                   @"\ue019"
+
+#define WIKIFONT_CHAR_ENVELOPE                   @"\ue020"
+
+#define WIKIFONT_CHAR_PIN                        @"\ue021"
+
+#define WIKIFONT_CHAR_CARET                      @"\ue022"
+
+#define WIKIFONT_CHAR_DOWNLOAD                   @"\ue023"
+
+
+
+/* STRIPES e040_043 */
+
+#define WIKIFONT_CHAR_STRIPE_COMPACT             @"\ue040"
+
+#define WIKIFONT_CHAR_STRIPE_TOC                 @"\ue041"
+
+#define WIKIFONT_CHAR_STRIPE_EXPANDED            @"\ue042"
+
+
+
+/* WIKIPEDIA LOGO e400_401 */
+
+#define WIKIFONT_CHAR_W                          @"\ue400"
+
+
+
+/* UI MODERATION ELEMENTS e500_508 */
+
+#define WIKIFONT_CHAR_ARTICLE                    @"\ue100"
+
+#define WIKIFONT_CHAR_ARTICLE_CHECK              @"\ue101"
+
+#define WIKIFONT_CHAR_ARTICLE_SEARCH             @"\ue102"
+
+
+#define WIKIFONT_CHAR_TRASH                      @"\ue500"
+
+#define WIKIFONT_CHAR_TRASH_SLASH                @"\ue501"
+
+#define WIKIFONT_CHAR_BLOCK                      @"\ue502"
+
+#define WIKIFONT_CHAR_BLOCK_SLASH                @"\ue503"
+
+#define WIKIFONT_CHAR_FLAG                       @"\ue504"
+
+#define WIKIFONT_CHAR_FLAG_SLASH                 @"\ue505"
+
+#define WIKIFONT_CHAR_PLAY                       @"\ue506"
+
+#define WIKIFONT_CHAR_STOP                       @"\ue507"
+
+#define WIKIFONT_CHAR_LOCK                       @"\ue508"
+
+
+
+/* USER e600_602 */
+
+#define WIKIFONT_CHAR_USER_BUST                  @"\ue600"
+
+#define WIKIFONT_CHAR_USER_SMILE                 @"\ue601"
+
+#define WIKIFONT_CHAR_USER_SLEEP                 @"\ue602"
+
+
+
+/* TRANSLATION e700 */
+
+#define WIKIFONT_CHAR_TRANSLATE                  @"\ue700"
+
+
+
+/* CONTRIBUTION e800_845 */
+
+#define WIKIFONT_CHAR_PENCIL                     @"\ue800"
+
+#define WIKIFONT_CHAR_PENCIL_REVERT              @"\ue801"
+
+#define WIKIFONT_CHAR_PENCIL_LOCK                @"\ue802"
+
+
+
+#define WIKIFONT_CHAR_SPEECH_BUBBLE              @"\ue810"
+
+#define WIKIFONT_CHAR_SPEECH_BUBBLES             @"\ue811"
+
+#define WIKIFONT_CHAR_SPEECH_BUBBLE_ADD          @"\ue812"
+
+#define WIKIFONT_CHAR_SPEECH_BUBBLE_SMILE        @"\ue813"
+
+
+
+#define WIKIFONT_CHAR_LINK                       @"\ue820"
+
+
+
+#define WIKIFONT_CHAR_QUOTES                     @"\ue830"
+
+#define WIKIFONT_CHAR_QUOTES_ADD                 @"\ue831"
+
+
+
+#define WIKIFONT_CHAR_IMAGE                      @"\ue840"
+
+#define WIKIFONT_CHAR_IMAGE_LOCK                 @"\ue841"
+
+#define WIKIFONT_CHAR_IMAGE_ADD                  @"\ue842"
+
+#define WIKIFONT_CHAR_IMAGE_MAIN_PLACEHOLDER     @"\ue843"
+
+#define WIKIFONT_CHAR_FOLDER                     @"\ue844"
+
+#define WIKIFONT_CHAR_FOLDER_MAIN_PLACEHOLDER    @"\ue845"
+
+
+
+/* WIKI_X e900 */
+
+#define WIKIFONT_CHAR_WIKITRAIL                  @"\ue900"
diff --git a/wikipedia/View Controllers/MainMenu/MainMenuViewController.m 
b/wikipedia/View Controllers/MainMenu/MainMenuViewController.m
index f800a3e..8d5ec72 100644
--- a/wikipedia/View Controllers/MainMenu/MainMenuViewController.m
+++ b/wikipedia/View Controllers/MainMenu/MainMenuViewController.m
@@ -25,6 +25,8 @@
 #import "PageHistoryViewController.h"
 #import "CreditsViewController.h"
 
+#import "WMF_WikiFont_Chars.h"
+
 #pragma mark - Defines
 
 #define NAV ((NavController *)self.navigationController)
@@ -232,35 +234,35 @@
       @{
           @"title": @"",
           @"tag": @(ROW_INDEX_LOGIN),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_USER_SLEEP,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": MWLocalizedString(@"main-menu-random", nil),
           @"tag": @(ROW_INDEX_RANDOM),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_DICE,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": MWLocalizedString(@"main-menu-show-history", nil),
           @"tag": @(ROW_INDEX_HISTORY),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_CLOCK,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": MWLocalizedString(@"main-menu-show-saved", nil),
           @"tag": @(ROW_INDEX_SAVED_PAGES),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_BOOKMARK,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": saveArticleTitle,
           @"tag": @(ROW_INDEX_SAVE_PAGE),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_DOWNLOAD,
           @"highlighted": @YES,
           }.mutableCopy
       ,
@@ -268,28 +270,28 @@
           @"domain": [SessionSingleton sharedInstance].domain,
           @"title": searchWikiTitle,
           @"tag": @(ROW_INDEX_SEARCH_LANGUAGE),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_TRANSLATE,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": MWLocalizedString(@"zero-warn-when-leaving", nil),
           @"tag": @(ROW_INDEX_ZERO_WARN_WHEN_LEAVING),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_FLAG,
           @"highlighted": @([SessionSingleton 
sharedInstance].zeroConfigState.warnWhenLeaving),
           }.mutableCopy
       ,
       @{
           @"title": MWLocalizedString(@"main-menu-send-feedback", nil),
           @"tag": @(ROW_INDEX_SEND_FEEDBACK),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_ENVELOPE,
           @"highlighted": @YES,
           }.mutableCopy
       ,
       @{
           @"title": pageHistoryTitle,
           @"tag": @(ROW_INDEX_PAGE_HISTORY),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_LINK,
           @"highlighted": @YES,
           }.mutableCopy
         ,
@@ -297,7 +299,7 @@
           @"domain": [SessionSingleton sharedInstance].domain,
           @"title": MWLocalizedString(@"main-menu-credits", nil),
           @"tag": @(ROW_INDEX_CREDITS),
-          @"icon": @"",
+          @"icon": WIKIFONT_CHAR_PUZZLE,
           @"highlighted": @YES,
           }.mutableCopy
       ].mutableCopy;
@@ -324,10 +326,10 @@
                             substitutionAttributes: 
@[self.highlightedTextAttributes]
          ];
         
-        loginIcon = @"";
+        loginIcon = WIKIFONT_CHAR_USER_SMILE;
     }else{
         loginTitle = MWLocalizedString(@"main-menu-account-login", nil);
-        loginIcon = @"";
+        loginIcon = WIKIFONT_CHAR_USER_SLEEP;
     }
     
     NSMutableDictionary *row = [self getRowWithTag:ROW_INDEX_LOGIN];
diff --git a/wikipedia/View Controllers/PageHistory/PageHistoryViewController.m 
b/wikipedia/View Controllers/PageHistory/PageHistoryViewController.m
index f5c30fe..81011db 100644
--- a/wikipedia/View Controllers/PageHistory/PageHistoryViewController.m
+++ b/wikipedia/View Controllers/PageHistory/PageHistoryViewController.m
@@ -14,6 +14,8 @@
 #import "NSDate-Utilities.h"
 #import "NSString+Extras.h"
 
+#import "WMF_WikiFont_Chars.h"
+
 #define NAV ((NavController *)self.navigationController)
 
 @interface PageHistoryViewController (){
@@ -170,7 +172,7 @@
         ;
 
     cell.iconLabel.attributedText =
-    [[NSAttributedString alloc] initWithString: row[@"anon"] ? @"" : @""
+    [[NSAttributedString alloc] initWithString: row[@"anon"] ? 
WIKIFONT_CHAR_USER_SLEEP : WIKIFONT_CHAR_USER_SMILE
                                     attributes: @{
                                                   NSFontAttributeName: [UIFont 
fontWithName:@"WikiFont-Regular" size:23],
                                                   
NSForegroundColorAttributeName : [UIColor colorWithRed:0.78 green:0.78 
blue:0.78 alpha:1.0],
diff --git a/wikipedia/View Controllers/TopNav/NavController.m b/wikipedia/View 
Controllers/TopNav/NavController.m
index 50a35b5..3b3ab83 100644
--- a/wikipedia/View Controllers/TopNav/NavController.m
+++ b/wikipedia/View Controllers/TopNav/NavController.m
@@ -25,6 +25,8 @@
 #import "NavButtonLabel.h"
 #import "PaddedLabel.h"
 
+#import "WMF_WikiFont_Chars.h"
+
 @interface NavController (){
 
 }
@@ -360,13 +362,13 @@
         return button;
     };
 
-    self.buttonPencil =     getButton(@"",     NAVBAR_BUTTON_PENCIL);
-    self.buttonCheck =      getButton(@"",     NAVBAR_BUTTON_CHECK);
-    self.buttonX =          getButton(@"",     NAVBAR_BUTTON_X);
-    self.buttonEye =        getButton(@"",     NAVBAR_BUTTON_EYE);
-    self.buttonArrowLeft =  getButton(@"",     NAVBAR_BUTTON_ARROW_LEFT);
-    self.buttonArrowRight = getButton(@"",     NAVBAR_BUTTON_ARROW_RIGHT);
-    self.buttonW =          getButton(@"",     NAVBAR_BUTTON_LOGO_W);
+    self.buttonPencil =     getButton(WIKIFONT_CHAR_PENCIL,         
NAVBAR_BUTTON_PENCIL);
+    self.buttonCheck =      getButton(WIKIFONT_CHAR_TICK,           
NAVBAR_BUTTON_CHECK);
+    self.buttonX =          getButton(WIKIFONT_CHAR_X,              
NAVBAR_BUTTON_X);
+    self.buttonEye =        getButton(WIKIFONT_CHAR_EYE,            
NAVBAR_BUTTON_EYE);
+    self.buttonArrowLeft =  getButton(WIKIFONT_CHAR_ARROW_LEFT,     
NAVBAR_BUTTON_ARROW_LEFT);
+    self.buttonArrowRight = getButton(WIKIFONT_CHAR_ARROW_LEFT,     
NAVBAR_BUTTON_ARROW_RIGHT);
+    self.buttonW =          getButton(WIKIFONT_CHAR_W,              
NAVBAR_BUTTON_LOGO_W);
 
     // Mirror the left arrow.
     self.buttonArrowRight.transform = CGAffineTransformMakeScale(-1.0, 1.0);
@@ -551,7 +553,7 @@
     
     // If the tapped item was a button, first animate it briefly, then post 
the notication.
     if([tappedView isKindOfClass:[NavButtonView class]]){
-        CGFloat animationScale = 1.15f;
+        CGFloat animationScale = 1.25f;
         NavButtonView *button = (NavButtonView *)tappedView;
         [button.label animateAndRewindXF: 
CATransform3DMakeScale(animationScale, animationScale, 1.0f)
                             afterDelay: 0.0

-- 
To view, visit https://gerrit.wikimedia.org/r/130237
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7515a61ebdb8bcc4111d18eb9f5118e88dc689c
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <mh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to