Commits

Trammell Hudson committed 1174a24

custom fonts

  • Participants
  • Parent commits 985734d

Comments (0)

Files changed (1)

File nederlands.c

 
 
 PBL_APP_INFO(
-	"Nederlandse",
+	"Hoe laat is het?",
 	"hudson",
 	1, // Version
 	INVALID_RESOURCE,
 	int hour = ptm->tm_hour;
 	int min = ptm->tm_min;
 
+	const char * old_min = min_text;
+	const char * old_rel = rel_text;
+	const char * old_hour = hour_text;
+	const char * old_ampm = ampm_text;
+
 	nederlands_format(hour,  min);
 
 /*
 	);
 */
 
+	text_layer_set_text(&ampm_layer, ampm_text);
+	text_layer_set_text(&hour_layer, hour_text);
+	text_layer_set_text(&rel_layer, rel_text);
 	text_layer_set_text(&min_layer, min_text);
-	text_layer_set_text(&rel_layer, rel_text);
-	text_layer_set_text(&hour_layer, hour_text);
-	text_layer_set_text(&ampm_layer, ampm_text);
 }
 
 
 text_layer(
 	TextLayer * layer,
 	GRect frame,
-	const char * font
+	int font
 )
 {
 	text_layer_init(layer, frame);
 	text_layer_set_text(layer, "");
 	text_layer_set_text_color(layer, GColorWhite);
-	text_layer_set_background_color(layer, GColorBlack);
-	text_layer_set_font(layer, fonts_get_system_font(font));
+	text_layer_set_background_color(layer, GColorClear);
+	text_layer_set_font(layer, fonts_load_custom_font(resource_get_handle(font)));
 
 	layer_add_child(&window.layer, &layer->layer);
 }
 	window_stack_push(&window, true);
 	window_set_background_color(&window, GColorBlack);
 
-	int y = 10;
-	int h = 30+2;
-	text_layer(&min_layer, GRect(0, y + 0*h, 144, h), FONT_KEY_GOTHIC_28_BOLD);
-	text_layer(&rel_layer, GRect(0, y + 1*h, 144, h), FONT_KEY_GOTHIC_28_BOLD);
-	text_layer(&hour_layer, GRect(0, y + 2*h, 144, h), FONT_KEY_GOTHAM_30_BLACK);
-	text_layer(&ampm_layer, GRect(0, y + 3*h, 144, h), FONT_KEY_GOTHIC_28_BOLD);
+	resource_init_current_app(&NEDERLANDS_RESOURCES);
+
+	int y = 15;
+	int h = 30;
+
+	// Stack top to bottom
+	text_layer(&ampm_layer, GRect(4, y + 3*h, 144, h+8), RESOURCE_ID_FONT_ANDALE_30);
+	text_layer(&hour_layer, GRect(4, y + 2*h, 144, h+8), RESOURCE_ID_FONT_ANDALE_30_BLACK);
+	text_layer(&rel_layer, GRect(4, y + 1*h, 144, h+8), RESOURCE_ID_FONT_ANDALE_30);
+	text_layer(&min_layer, GRect(4, y + 0*h, 144, h+8), RESOURCE_ID_FONT_ANDALE_30);
 }