diff --git a/.project b/.project index 6f256d7..59d3f31 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded diff --git a/README.md b/README.md index 7baa557..84f6845 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# Garmin Connect IQ fenix 5 watch face: Digital 5 +# Garmin Connect IQ fenix 5 watch face: Digital 5 Reloaded -ATTENTION: THIS WATCH FACE WON’T BE UPDATED ANY LONGER!!! +**History** -![Overview](https://www.dropbox.com/s/9uc7ojnt97x7otv/Digital5Overview.png) +Digital5 was a Garmin Connect IQ watch face, created for the fenix 5 range. Its developer, [Gerrit Grunwald](https://twitter.com/hansolo_), discontinued working on this watch face earlier this year. I still think it was one of the better faces, striking a balance between number of "data" fields, and readability. + +I've decided to take over the project, and call it "Digital5Reloaded" - of course this is with the permission of Gerrit. Thanks! + +**Overview** A simple digital watch face for the Garmin fenix 5x which shows the following data: - date @@ -14,7 +18,7 @@ A simple digital watch face for the Garmin fenix 5x which shows the following da - steps - steps needed to reach daily goal - calories burned -- active calories burned (calcluated after Mifflin-St.Jeor Formula (1990)) +- active calories burned ([calculated after Mifflin-St.Jeor Formula (1990)](https://www.ncbi.nlm.nih.gov/pubmed/2305711)) - distance - move bar - last measured heart rate @@ -25,9 +29,7 @@ A simple digital watch face for the Garmin fenix 5x which shows the following da - active time of the last week - active time of today - sunrise and sunset ([calculated after Sunrise/Sunset Algorithm](http://williams.best.vwh.net/sunrise_sunset_algorithm.htm)) -- weather - -([Powered by Dark Sky](https://darksky.net/poweredby/)) +- weather ([Powered by Dark Sky](https://darksky.net/poweredby/), requires Dark Sky API key (free)) The LCD background can be switched off and the heart rate zone could be visualized by colors. On the left side it will show the daily step goal in a colored bar (is the bar green then the daily stepgoal is reached). On the right side it shows the burned calories where the bar is blue as long as you have not reached your daily base calorie consumption, it will turn green when the burned calories are higher than your daily base calorie consumption. Are the burned calories more than 2x the base calorie consumption the bar will turn pink. @@ -59,25 +61,29 @@ All segments pink = 3x base calories burned The sunrise/sunset is calculated by an algorithm found at http://williams.best.vwh.net/sunrise_sunset_algorithm.htm. To be able to calculate the sunrise/sunset you have to put in the current location (latitude, longitude) and the current -timezone you are in. If you have daylight saving time in your current timezone please check the "Daylight saving time (current location)" checkbox. +time zone you are in. If you have daylight saving time in your current time zone please check the "Daylight saving time (current location)" checkbox. + + -ATTENTION: -Instead of giving negative reviews please file an issue at the [github issuetracker](https://github.com/HanSolo/digital5/issues) when you encounter problems. -By using the issue tracker you can describe your problem and I can try to reproduce and fix it, thanks. +**Weather** To make use of the Weather feature you need your own Dark Sky API key, to get one please follow the steps below: -1) Go to the [DarkSky website](https://darksky.net/dev/) +1. Go to the [DarkSky website](https://darksky.net/dev/) -2) Create your own account and you'll see a 32 character key +2. Create your own account and you'll see a 32 character key -3) This key you need to put in the watch face settings either on your phone or via Garmin Express. +3. This key you need to put in the watch face settings either on your phone or via Garmin Express. -4) Make sure you have the coordinates of your current location (latitude, longitude) put in the settings +4. Make sure you have the coordinates of your current location (latitude, longitude) put in the settings At the moment the weather update is done every 15 minutes. -You can choose between daily or current weather information where the daily weather will show you an icon for -today and the min and max temperature for today. The current weather information will show you an icon for the -current weather and the current temperature. + +You can choose between daily or current weather information where the daily weather will show you an icon for today and the min and max temperature for today. The current weather information will show you an icon for the current weather and the current temperature. + + + +**Reporting issues** +Please use the [github issuetracker](https://github.com/erikvb/Digital5Reloaded/issues) when you encounter problems. By using the issue tracker you can describe your problem and I can try to reproduce and fix it, thanks. \ No newline at end of file diff --git a/barrels.jungle b/barrels.jungle index d651239..c8f30d1 100644 --- a/barrels.jungle +++ b/barrels.jungle @@ -1,10 +1,3 @@ # Do not hand edit this file. To make changes right click # on the project and select "Configure Monkey Barrels". -fr935.excludeAnnotations = d2charlie;fenix5;fenix5x;fenix5xplus;vivoactive3;vivoactive3m -d2charlie.excludeAnnotations = fr935;fenix5;fenix5x;fenix5xplus;vivoactive3;vivoactive3m -fenix5.excludeAnnotations = fr935;d2charlie;fenix5x;fenix5xplus;vivoactive3;vivoactive3m -fenix5x.excludeAnnotations = fr935;d2charlie;fenix5;fenix5xplus;vivoactive3;vivoactive3m -fenix5xplus.excludeAnnotations = fr935;d2charlie;fenix5;fenix5x;vivoactive3;vivoactive3m -vivoactive3.excludeAnnotations = fr935;d2charlie;fenix5;fenix5x;fenix5xplus;vivoactive3m -vivoactive3m.excludeAnnotations = fr935;d2charlie;fenix5;fenix5x;fenix5xplus;vivoactive3 \ No newline at end of file diff --git a/manifest.xml b/manifest.xml index 8dfd5ec..a0b6115 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,14 +1,37 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monkey.jungle b/monkey.jungle index d420965..45c1bf8 100644 --- a/monkey.jungle +++ b/monkey.jungle @@ -1,10 +1,2 @@ project.manifest = manifest.xml - -vivoactive3.sourcePath = source;source-vivoactive3 -vivoactive3m.sourcePath = source;source-vivoactive3m -fr935.sourcePath = source;source-fr935 -d2charlie.sourcePath = source;source-d2charlie -fenix5.sourcePath = source;source-fenix5 -fenix5x.sourcePath = source;source-fenix5x -fenix5xplus.sourcePath = source;source-fenix5xplus diff --git a/resources-d2charlie/ciqbuild.xml b/resources-d2charlie/ciqbuild.xml deleted file mode 100644 index 39e0cc3..0000000 --- a/resources-d2charlie/ciqbuild.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/resources-d2charlie/drawables/drawables.xml b/resources-d2charlie/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-d2charlie/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-d2charlie/drawables/launcher_icon.png b/resources-d2charlie/drawables/launcher_icon.png deleted file mode 100644 index 9e5e332..0000000 Binary files a/resources-d2charlie/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-d2charlie/resources.xml b/resources-d2charlie/resources.xml deleted file mode 100644 index 917c8a8..0000000 --- a/resources-d2charlie/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - d2charlie - \ No newline at end of file diff --git a/resources-d2charlie/strings/strings.xml b/resources-d2charlie/strings/strings.xml deleted file mode 100644 index 93e4adc..0000000 --- a/resources-d2charlie/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - D2 Charlie - \ No newline at end of file diff --git a/resources-deu/strings/strings.xml b/resources-deu/strings/strings.xml index c76528c..a27084b 100644 --- a/resources-deu/strings/strings.xml +++ b/resources-deu/strings/strings.xml @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded Geschlecht Weiblich @@ -46,6 +46,7 @@ Sommerzeit Heimat Zeitzone anzeigen + Heimat Datum anzeigen Heimat Zeitzone diff --git a/resources-eng/strings/strings.xml b/resources-eng/strings/strings.xml index 8c5656a..bf09c2b 100644 --- a/resources-eng/strings/strings.xml +++ b/resources-eng/strings/strings.xml @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded Gender Female @@ -46,6 +46,7 @@ Daylight Saving Time (home location) Show Home Timezone + Show Home Date Timezone (home location) diff --git a/resources-fenix5/ciqbuild.xml b/resources-fenix5/ciqbuild.xml deleted file mode 100644 index 2a21f16..0000000 --- a/resources-fenix5/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-fenix5/drawables/drawables.xml b/resources-fenix5/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-fenix5/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-fenix5/drawables/launcher_icon.png b/resources-fenix5/drawables/launcher_icon.png deleted file mode 100644 index 9e5e332..0000000 Binary files a/resources-fenix5/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-fenix5/resources.xml b/resources-fenix5/resources.xml deleted file mode 100644 index b45f255..0000000 --- a/resources-fenix5/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - fenix5 - \ No newline at end of file diff --git a/resources-fenix5/strings/strings.xml b/resources-fenix5/strings/strings.xml deleted file mode 100644 index 0d53546..0000000 --- a/resources-fenix5/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Fenix 5 - \ No newline at end of file diff --git a/resources-fenix5x/ciqbuild.xml b/resources-fenix5x/ciqbuild.xml deleted file mode 100644 index ad7221b..0000000 --- a/resources-fenix5x/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-fenix5x/drawables/drawables.xml b/resources-fenix5x/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-fenix5x/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-fenix5x/drawables/launcher_icon.png b/resources-fenix5x/drawables/launcher_icon.png deleted file mode 100644 index 9e5e332..0000000 Binary files a/resources-fenix5x/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-fenix5x/resources.xml b/resources-fenix5x/resources.xml deleted file mode 100644 index bd86b07..0000000 --- a/resources-fenix5x/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - fenix5x - \ No newline at end of file diff --git a/resources-fenix5x/strings/strings.xml b/resources-fenix5x/strings/strings.xml deleted file mode 100644 index e8a9a31..0000000 --- a/resources-fenix5x/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Fenix 5x - \ No newline at end of file diff --git a/resources-fenix5xplus/ciqbuild.xml b/resources-fenix5xplus/ciqbuild.xml deleted file mode 100644 index b237384..0000000 --- a/resources-fenix5xplus/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-fenix5xplus/drawables/drawables.xml b/resources-fenix5xplus/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-fenix5xplus/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-fenix5xplus/drawables/launcher_icon.png b/resources-fenix5xplus/drawables/launcher_icon.png deleted file mode 100644 index 9e5e332..0000000 Binary files a/resources-fenix5xplus/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-fenix5xplus/resources.xml b/resources-fenix5xplus/resources.xml deleted file mode 100644 index 70d5a7f..0000000 --- a/resources-fenix5xplus/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - fenix5xplus - \ No newline at end of file diff --git a/resources-fenix5xplus/strings/strings.xml b/resources-fenix5xplus/strings/strings.xml deleted file mode 100644 index ebccc5c..0000000 --- a/resources-fenix5xplus/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Fenix 5 Plus - \ No newline at end of file diff --git a/resources-fr935/ciqbuild.xml b/resources-fr935/ciqbuild.xml deleted file mode 100644 index 78bcbe7..0000000 --- a/resources-fr935/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-fr935/drawables/drawables.xml b/resources-fr935/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-fr935/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-fr935/drawables/launcher_icon.png b/resources-fr935/drawables/launcher_icon.png deleted file mode 100644 index 9e5e332..0000000 Binary files a/resources-fr935/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-fr935/resources.xml b/resources-fr935/resources.xml deleted file mode 100644 index 0f2173d..0000000 --- a/resources-fr935/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - fr935 - \ No newline at end of file diff --git a/resources-fr935/strings/strings.xml b/resources-fr935/strings/strings.xml deleted file mode 100644 index 0a6cb3d..0000000 --- a/resources-fr935/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - fr935 - \ No newline at end of file diff --git a/resources-fre/strings/strings.xml b/resources-fre/strings/strings.xml index faf09e7..34ff815 100644 --- a/resources-fre/strings/strings.xml +++ b/resources-fre/strings/strings.xml @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded Sexe Femme @@ -46,6 +46,7 @@ Heure d'été Afficher le fuseau horaire Domicile + Afficher la date de domicile Fuseau horaire Domicile diff --git a/resources-hun/strings/strings.xml b/resources-hun/strings/strings.xml index 9940b42..4fbd623 100644 --- a/resources-hun/strings/strings.xml +++ b/resources-hun/strings/strings.xml @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded Nem @@ -41,11 +41,12 @@ Lcd betűtipus az adatmezőkön - Bigger battery font + Nagyobb betűtípus Nyári időszámítás Otthoni időzóna mutatása + Az otthoni dátum megjelenítése Otthoni időzóna diff --git a/resources-spa/strings/strings.xml b/resources-spa/strings/strings.xml index 02ffdd4..b2cf5ff 100644 --- a/resources-spa/strings/strings.xml +++ b/resources-spa/strings/strings.xml @@ -1,6 +1,6 @@ - Digital5 + Digital5Reloaded Género     Femenino @@ -46,6 +46,7 @@ Horario de Verano Mostrar zona horaria local + Mostrar fecha de inicio Desfase zona horaria local diff --git a/resources-vivoactive3/ciqbuild.xml b/resources-vivoactive3/ciqbuild.xml deleted file mode 100644 index 126bb74..0000000 --- a/resources-vivoactive3/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-vivoactive3/drawables/drawables.xml b/resources-vivoactive3/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-vivoactive3/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-vivoactive3/drawables/launcher_icon.png b/resources-vivoactive3/drawables/launcher_icon.png deleted file mode 100644 index a25cdb4..0000000 Binary files a/resources-vivoactive3/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-vivoactive3/resources.xml b/resources-vivoactive3/resources.xml deleted file mode 100644 index a1ae17f..0000000 --- a/resources-vivoactive3/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - vivoactive3 - \ No newline at end of file diff --git a/resources-vivoactive3/strings/strings.xml b/resources-vivoactive3/strings/strings.xml deleted file mode 100644 index b3f513e..0000000 --- a/resources-vivoactive3/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Vivoactive 3 - \ No newline at end of file diff --git a/resources-vivoactive3m/ciqbuild.xml b/resources-vivoactive3m/ciqbuild.xml deleted file mode 100644 index 46f98aa..0000000 --- a/resources-vivoactive3m/ciqbuild.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/resources-vivoactive3m/drawables/drawables.xml b/resources-vivoactive3m/drawables/drawables.xml deleted file mode 100644 index c89904c..0000000 --- a/resources-vivoactive3m/drawables/drawables.xml +++ /dev/null @@ -1,3 +0,0 @@ - - 000000FFFFFF - \ No newline at end of file diff --git a/resources-vivoactive3m/drawables/launcher_icon.png b/resources-vivoactive3m/drawables/launcher_icon.png deleted file mode 100644 index a25cdb4..0000000 Binary files a/resources-vivoactive3m/drawables/launcher_icon.png and /dev/null differ diff --git a/resources-vivoactive3m/resources.xml b/resources-vivoactive3m/resources.xml deleted file mode 100644 index 5a4bc00..0000000 --- a/resources-vivoactive3m/resources.xml +++ /dev/null @@ -1,3 +0,0 @@ - - vivoactive3m - \ No newline at end of file diff --git a/resources-vivoactive3m/strings/strings.xml b/resources-vivoactive3m/strings/strings.xml deleted file mode 100644 index 5caa48e..0000000 --- a/resources-vivoactive3m/strings/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Vivoactive 3 Music - \ No newline at end of file diff --git a/resources/buildDefault.xml b/resources/buildDefault.xml deleted file mode 100644 index f1edbc7..0000000 --- a/resources/buildDefault.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/drawables/launcher_icon.png b/resources/drawables/launcher_icon.png index 9e5e332..a3dd353 100644 Binary files a/resources/drawables/launcher_icon.png and b/resources/drawables/launcher_icon.png differ diff --git a/resources/fonts/RobotoCondensed_14.fnt b/resources/fonts/RobotoCondensed_14.fnt deleted file mode 100644 index 3e7cf60..0000000 --- a/resources/fonts/RobotoCondensed_14.fnt +++ /dev/null @@ -1,101 +0,0 @@ -info face="RobotoCondensed-Regular" size=14 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 -common lineHeight=19 base=15 scaleW=512 scaleH=512 pages=1 packed=0 -page id=0 file="RobotoCondensed_14.png" -chars count=97 -char id=0 x=255 y=0 width=598 height=21 xoffset=-1 yoffset=-1 xadvance=0 page=0 chnl=0 -char id=10 x=255 y=0 width=205 height=21 xoffset=-1 yoffset=-1 xadvance=0 page=0 chnl=0 -char id=32 x=255 y=0 width=436 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=33 x=257 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=34 x=251 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=35 x=433 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=36 x=389 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=37 x=404 y=21 width=11 height=21 xoffset=-1 yoffset=-1 xadvance=9 page=0 chnl=0 -char id=38 x=449 y=21 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=39 x=276 y=21 width=4 height=21 xoffset=-1 yoffset=-1 xadvance=2 page=0 chnl=0 -char id=40 x=300 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=41 x=306 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=42 x=469 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=43 x=415 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=44 x=285 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=45 x=398 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=46 x=280 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=47 x=355 y=21 width=7 height=21 xoffset=-1 yoffset=-1 xadvance=5 page=0 chnl=0 -char id=48 x=242 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=49 x=161 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=50 x=170 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=51 x=179 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=52 x=188 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=53 x=197 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=54 x=206 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=55 x=215 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=56 x=224 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=57 x=233 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=58 x=295 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=59 x=290 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=60 x=334 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=61 x=424 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=62 x=342 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=63 x=268 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=64 x=362 y=21 width=13 height=21 xoffset=-1 yoffset=-1 xadvance=11 page=0 chnl=0 -char id=65 x=0 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=66 x=10 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=67 x=20 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=68 x=29 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=69 x=39 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=70 x=48 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=71 x=57 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=72 x=67 y=0 width=11 height=21 xoffset=-1 yoffset=-1 xadvance=9 page=0 chnl=0 -char id=73 x=78 y=0 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=74 x=84 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=75 x=93 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=76 x=103 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=77 x=112 y=0 width=12 height=21 xoffset=-1 yoffset=-1 xadvance=10 page=0 chnl=0 -char id=78 x=124 y=0 width=11 height=21 xoffset=-1 yoffset=-1 xadvance=9 page=0 chnl=0 -char id=79 x=135 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=80 x=145 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=81 x=155 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=82 x=165 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=83 x=175 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=84 x=184 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=85 x=193 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=86 x=203 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=87 x=213 y=0 width=13 height=21 xoffset=-1 yoffset=-1 xadvance=11 page=0 chnl=0 -char id=88 x=226 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=89 x=236 y=0 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 -char id=90 x=246 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=91 x=312 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=92 x=375 y=21 width=7 height=21 xoffset=-1 yoffset=-1 xadvance=5 page=0 chnl=0 -char id=93 x=317 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=94 x=382 y=21 width=7 height=21 xoffset=-1 yoffset=-1 xadvance=5 page=0 chnl=0 -char id=95 x=442 y=21 width=7 height=21 xoffset=-1 yoffset=-1 xadvance=5 page=0 chnl=0 -char id=96 x=262 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=97 x=460 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=98 x=469 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=99 x=478 y=0 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=100 x=486 y=0 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=101 x=495 y=0 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=102 x=503 y=0 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=103 x=0 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=104 x=9 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=105 x=18 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=106 x=23 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=107 x=28 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=108 x=36 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=109 x=41 y=21 width=12 height=21 xoffset=-1 yoffset=-1 xadvance=10 page=0 chnl=0 -char id=110 x=53 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=111 x=62 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=112 x=71 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=113 x=80 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=114 x=89 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=115 x=95 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=116 x=103 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=117 x=109 y=21 width=9 height=21 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 -char id=118 x=118 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=119 x=126 y=21 width=11 height=21 xoffset=-1 yoffset=-1 xadvance=9 page=0 chnl=0 -char id=120 x=137 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=121 x=145 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=122 x=153 y=21 width=8 height=21 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 -char id=123 x=322 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=124 x=350 y=21 width=5 height=21 xoffset=-1 yoffset=-1 xadvance=3 page=0 chnl=0 -char id=125 x=328 y=21 width=6 height=21 xoffset=-1 yoffset=-1 xadvance=4 page=0 chnl=0 -char id=126 x=459 y=21 width=10 height=21 xoffset=-1 yoffset=-1 xadvance=8 page=0 chnl=0 diff --git a/resources/fonts/RobotoCondensed_14.png b/resources/fonts/RobotoCondensed_14.png deleted file mode 100644 index 30abd77..0000000 Binary files a/resources/fonts/RobotoCondensed_14.png and /dev/null differ diff --git a/resources/fonts/RobotoCondensed_20.fnt b/resources/fonts/RobotoCondensed_20.fnt new file mode 100644 index 0000000..371ed41 --- /dev/null +++ b/resources/fonts/RobotoCondensed_20.fnt @@ -0,0 +1,19 @@ +info face="Roboto Condensed" size=20 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0 +common lineHeight=20 base=16 scaleW=64 scaleH=64 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="RobotoCondensed_20.png" +chars count=13 +char id=48 x=21 y=0 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=49 x=57 y=0 width=5 height=12 xoffset=1 yoffset=4 xadvance=8 page=0 chnl=15 +char id=50 x=30 y=0 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=51 x=39 y=0 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=52 x=48 y=0 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=53 x=36 y=13 width=7 height=12 xoffset=1 yoffset=4 xadvance=8 page=0 chnl=15 +char id=54 x=0 y=13 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=55 x=9 y=13 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=56 x=18 y=13 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=57 x=27 y=13 width=8 height=12 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=58 x=44 y=13 width=4 height=9 xoffset=0 yoffset=7 xadvance=4 page=0 chnl=15 +char id=65 x=0 y=0 width=10 height=12 xoffset=0 yoffset=4 xadvance=10 page=0 chnl=15 +char id=80 x=11 y=0 width=9 height=12 xoffset=0 yoffset=4 xadvance=9 page=0 chnl=15 +kernings count=1 +kerning first=80 second=65 amount=-1 diff --git a/resources/fonts/RobotoCondensed_20.png b/resources/fonts/RobotoCondensed_20.png new file mode 100644 index 0000000..ba9a4e7 Binary files /dev/null and b/resources/fonts/RobotoCondensed_20.png differ diff --git a/resources/fonts/RobotoCondensed_24.fnt b/resources/fonts/RobotoCondensed_24.fnt new file mode 100644 index 0000000..fe00782 --- /dev/null +++ b/resources/fonts/RobotoCondensed_24.fnt @@ -0,0 +1,209 @@ +info face="Roboto Condensed" size=24 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0 +common lineHeight=24 base=19 scaleW=512 scaleH=512 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="RobotoCondensed_24.png" +chars count=95 +char id=32 x=344 y=15 width=1 height=1 xoffset=0 yoffset=0 xadvance=5 page=0 chnl=15 +char id=33 x=100 y=16 width=3 height=14 xoffset=1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=34 x=294 y=15 width=5 height=6 xoffset=1 yoffset=4 xadvance=6 page=0 chnl=15 +char id=35 x=435 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=36 x=26 y=0 width=8 height=19 xoffset=1 yoffset=2 xadvance=10 page=0 chnl=15 +char id=37 x=231 y=0 width=12 height=14 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=15 +char id=38 x=413 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=39 x=300 y=15 width=3 height=6 xoffset=0 yoffset=4 xadvance=3 page=0 chnl=15 +char id=40 x=0 y=0 width=5 height=21 xoffset=1 yoffset=3 xadvance=6 page=0 chnl=15 +char id=41 x=6 y=0 width=5 height=21 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=15 +char id=42 x=267 y=15 width=9 height=9 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15 +char id=43 x=104 y=16 width=9 height=12 xoffset=0 yoffset=6 xadvance=10 page=0 chnl=15 +char id=44 x=315 y=15 width=3 height=5 xoffset=0 yoffset=17 xadvance=4 page=0 chnl=15 +char id=45 x=334 y=15 width=5 height=3 xoffset=0 yoffset=12 xadvance=5 page=0 chnl=15 +char id=46 x=340 y=15 width=3 height=2 xoffset=1 yoffset=17 xadvance=5 page=0 chnl=15 +char id=47 x=165 y=0 width=7 height=15 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=15 +char id=48 x=37 y=20 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=49 x=89 y=16 width=6 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=50 x=391 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=51 x=496 y=0 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=52 x=380 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=53 x=55 y=19 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=54 x=19 y=21 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=55 x=486 y=0 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=56 x=64 y=19 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=57 x=10 y=22 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=58 x=245 y=15 width=3 height=11 xoffset=1 yoffset=8 xadvance=5 page=0 chnl=15 +char id=59 x=506 y=0 width=4 height=14 xoffset=0 yoffset=8 xadvance=4 page=0 chnl=15 +char id=60 x=258 y=15 width=8 height=10 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=61 x=285 y=15 width=8 height=7 xoffset=1 yoffset=10 xadvance=10 page=0 chnl=15 +char id=62 x=249 y=15 width=8 height=10 xoffset=1 yoffset=8 xadvance=9 page=0 chnl=15 +char id=63 x=73 y=18 width=8 height=14 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=15 +char id=64 x=50 y=0 width=15 height=18 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15 +char id=65 x=218 y=0 width=12 height=14 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=66 x=456 y=0 width=9 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=67 x=244 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=15 +char id=68 x=446 y=0 width=9 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=69 x=466 y=0 width=9 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=70 x=46 y=20 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=71 x=314 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=72 x=325 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=73 x=96 y=16 width=3 height=14 xoffset=1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=74 x=476 y=0 width=9 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=75 x=336 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=76 x=28 y=20 width=8 height=14 xoffset=1 yoffset=5 xadvance=10 page=0 chnl=15 +char id=77 x=204 y=0 width=13 height=14 xoffset=1 yoffset=5 xadvance=15 page=0 chnl=15 +char id=78 x=347 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=79 x=292 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=80 x=369 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=81 x=66 y=0 width=10 height=17 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=82 x=303 y=0 width=10 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=83 x=402 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=84 x=358 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=85 x=0 y=22 width=9 height=14 xoffset=1 yoffset=5 xadvance=11 page=0 chnl=15 +char id=86 x=256 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=15 +char id=87 x=188 y=0 width=15 height=14 xoffset=0 yoffset=5 xadvance=15 page=0 chnl=15 +char id=88 x=268 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=11 page=0 chnl=15 +char id=89 x=280 y=0 width=11 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=90 x=424 y=0 width=10 height=14 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=91 x=35 y=0 width=4 height=19 xoffset=1 yoffset=3 xadvance=5 page=0 chnl=15 +char id=92 x=156 y=0 width=8 height=15 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=15 +char id=93 x=40 y=0 width=4 height=19 xoffset=0 yoffset=3 xadvance=5 page=0 chnl=15 +char id=94 x=277 y=15 width=7 height=8 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=15 +char id=95 x=325 y=15 width=8 height=3 xoffset=0 yoffset=18 xadvance=8 page=0 chnl=15 +char id=96 x=319 y=15 width=5 height=4 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=15 +char id=97 x=230 y=15 width=8 height=11 xoffset=1 yoffset=8 xadvance=10 page=0 chnl=15 +char id=98 x=147 y=0 width=8 height=15 xoffset=1 yoffset=4 xadvance=10 page=0 chnl=15 +char id=99 x=153 y=16 width=9 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=100 x=101 y=0 width=9 height=15 xoffset=0 yoffset=4 xadvance=10 page=0 chnl=15 +char id=101 x=163 y=16 width=9 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=102 x=173 y=0 width=6 height=15 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=15 +char id=103 x=91 y=0 width=9 height=15 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=15 +char id=104 x=138 y=0 width=8 height=15 xoffset=1 yoffset=4 xadvance=10 page=0 chnl=15 +char id=105 x=184 y=0 width=3 height=15 xoffset=1 yoffset=4 xadvance=5 page=0 chnl=15 +char id=106 x=45 y=0 width=4 height=19 xoffset=-1 yoffset=4 xadvance=4 page=0 chnl=15 +char id=107 x=111 y=0 width=8 height=15 xoffset=1 yoffset=4 xadvance=9 page=0 chnl=15 +char id=108 x=180 y=0 width=3 height=15 xoffset=1 yoffset=4 xadvance=5 page=0 chnl=15 +char id=109 x=114 y=16 width=13 height=11 xoffset=1 yoffset=8 xadvance=15 page=0 chnl=15 +char id=110 x=203 y=15 width=8 height=11 xoffset=1 yoffset=8 xadvance=10 page=0 chnl=15 +char id=111 x=142 y=16 width=10 height=11 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=15 +char id=112 x=129 y=0 width=8 height=15 xoffset=1 yoffset=8 xadvance=10 page=0 chnl=15 +char id=113 x=81 y=0 width=9 height=15 xoffset=0 yoffset=8 xadvance=10 page=0 chnl=15 +char id=114 x=239 y=15 width=5 height=11 xoffset=1 yoffset=8 xadvance=6 page=0 chnl=15 +char id=115 x=173 y=16 width=9 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=116 x=82 y=16 width=6 height=14 xoffset=0 yoffset=5 xadvance=6 page=0 chnl=15 +char id=117 x=212 y=15 width=8 height=11 xoffset=1 yoffset=8 xadvance=10 page=0 chnl=15 +char id=118 x=183 y=16 width=9 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=119 x=128 y=16 width=13 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15 +char id=120 x=193 y=15 width=9 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=121 x=120 y=0 width=8 height=15 xoffset=0 yoffset=8 xadvance=8 page=0 chnl=15 +char id=122 x=221 y=15 width=8 height=11 xoffset=0 yoffset=8 xadvance=9 page=0 chnl=15 +char id=123 x=12 y=0 width=6 height=20 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=15 +char id=124 x=77 y=0 width=3 height=17 xoffset=1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=125 x=19 y=0 width=6 height=20 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=15 +char id=126 x=304 y=15 width=10 height=5 xoffset=1 yoffset=11 xadvance=12 page=0 chnl=15 +kernings count=109 +kerning first=34 second=99 amount=-1 +kerning first=34 second=100 amount=-1 +kerning first=34 second=101 amount=-1 +kerning first=34 second=103 amount=-1 +kerning first=34 second=113 amount=-1 +kerning first=34 second=111 amount=-1 +kerning first=34 second=65 amount=-1 +kerning first=34 second=115 amount=-1 +kerning first=34 second=34 amount=-1 +kerning first=34 second=39 amount=-1 +kerning first=39 second=99 amount=-1 +kerning first=39 second=100 amount=-1 +kerning first=39 second=101 amount=-1 +kerning first=39 second=103 amount=-1 +kerning first=39 second=113 amount=-1 +kerning first=39 second=111 amount=-1 +kerning first=39 second=65 amount=-1 +kerning first=39 second=115 amount=-1 +kerning first=39 second=34 amount=-1 +kerning first=39 second=39 amount=-1 +kerning first=44 second=34 amount=-2 +kerning first=44 second=39 amount=-2 +kerning first=46 second=34 amount=-2 +kerning first=46 second=39 amount=-2 +kerning first=65 second=84 amount=-1 +kerning first=65 second=89 amount=-1 +kerning first=65 second=34 amount=-1 +kerning first=65 second=39 amount=-1 +kerning first=65 second=87 amount=-1 +kerning first=65 second=86 amount=-1 +kerning first=66 second=89 amount=-1 +kerning first=68 second=44 amount=-1 +kerning first=68 second=46 amount=-1 +kerning first=75 second=45 amount=-1 +kerning first=76 second=67 amount=-1 +kerning first=76 second=71 amount=-1 +kerning first=76 second=79 amount=-1 +kerning first=76 second=81 amount=-1 +kerning first=76 second=118 amount=-1 +kerning first=76 second=121 amount=-1 +kerning first=76 second=85 amount=-1 +kerning first=76 second=84 amount=-3 +kerning first=76 second=89 amount=-2 +kerning first=76 second=34 amount=-3 +kerning first=76 second=39 amount=-3 +kerning first=76 second=87 amount=-1 +kerning first=76 second=86 amount=-2 +kerning first=79 second=44 amount=-1 +kerning first=79 second=46 amount=-1 +kerning first=80 second=65 amount=-1 +kerning first=80 second=44 amount=-3 +kerning first=80 second=46 amount=-3 +kerning first=80 second=74 amount=-2 +kerning first=84 second=99 amount=-1 +kerning first=84 second=100 amount=-1 +kerning first=84 second=101 amount=-1 +kerning first=84 second=103 amount=-1 +kerning first=84 second=113 amount=-1 +kerning first=84 second=109 amount=-1 +kerning first=84 second=110 amount=-1 +kerning first=84 second=112 amount=-1 +kerning first=84 second=111 amount=-1 +kerning first=84 second=117 amount=-1 +kerning first=84 second=65 amount=-1 +kerning first=84 second=97 amount=-1 +kerning first=84 second=118 amount=-1 +kerning first=84 second=121 amount=-1 +kerning first=84 second=115 amount=-1 +kerning first=84 second=122 amount=-1 +kerning first=84 second=120 amount=-1 +kerning first=84 second=44 amount=-2 +kerning first=84 second=46 amount=-2 +kerning first=84 second=45 amount=-2 +kerning first=84 second=74 amount=-2 +kerning first=86 second=65 amount=-1 +kerning first=86 second=44 amount=-2 +kerning first=86 second=46 amount=-2 +kerning first=87 second=44 amount=-1 +kerning first=87 second=46 amount=-1 +kerning first=87 second=45 amount=-1 +kerning first=89 second=99 amount=-1 +kerning first=89 second=100 amount=-1 +kerning first=89 second=101 amount=-1 +kerning first=89 second=103 amount=-1 +kerning first=89 second=113 amount=-1 +kerning first=89 second=111 amount=-1 +kerning first=89 second=65 amount=-1 +kerning first=89 second=97 amount=-1 +kerning first=89 second=85 amount=-1 +kerning first=89 second=115 amount=-1 +kerning first=89 second=44 amount=-2 +kerning first=89 second=46 amount=-2 +kerning first=89 second=74 amount=-1 +kerning first=97 second=34 amount=-1 +kerning first=97 second=39 amount=-1 +kerning first=104 second=34 amount=-1 +kerning first=104 second=39 amount=-1 +kerning first=109 second=34 amount=-1 +kerning first=109 second=39 amount=-1 +kerning first=110 second=34 amount=-1 +kerning first=110 second=39 amount=-1 +kerning first=111 second=34 amount=-1 +kerning first=111 second=39 amount=-1 +kerning first=114 second=44 amount=-1 +kerning first=114 second=46 amount=-1 +kerning first=118 second=44 amount=-1 +kerning first=118 second=46 amount=-1 +kerning first=121 second=44 amount=-1 +kerning first=121 second=46 amount=-1 diff --git a/resources/fonts/RobotoCondensed_24.png b/resources/fonts/RobotoCondensed_24.png new file mode 100644 index 0000000..1a06a57 Binary files /dev/null and b/resources/fonts/RobotoCondensed_24.png differ diff --git a/resources/fonts/RobotoCondensed_7.bmfc b/resources/fonts/RobotoCondensed_7.bmfc new file mode 100644 index 0000000..320ab14 --- /dev/null +++ b/resources/fonts/RobotoCondensed_7.bmfc @@ -0,0 +1,55 @@ +# AngelCode Bitmap Font Generator configuration file +fileVersion=1 + +# font settings +fontName=Roboto Condensed +fontFile= +charSet=0 +fontSize=12 +aa=1 +scaleH=100 +useSmoothing=1 +isBold=0 +isItalic=0 +useUnicode=1 +disableBoxChars=1 +outputInvalidCharGlyph=0 +dontIncludeKerningPairs=0 +useHinting=1 +renderFromOutline=1 +useClearType=1 + +# character alignment +paddingDown=0 +paddingUp=0 +paddingRight=0 +paddingLeft=0 +spacingHoriz=1 +spacingVert=1 +useFixedHeight=0 +forceZero=0 + +# output file +outWidth=32 +outHeight=32 +outBitDepth=8 +fontDescFormat=0 +fourChnlPacked=0 +textureFormat=png +textureCompression=0 +alphaChnl=0 +redChnl=0 +greenChnl=0 +blueChnl=0 +invA=0 +invR=0 +invG=0 +invB=0 + +# outline +outlineThickness=0 + +# selected chars +chars=70,98-99,102,105,107,109,116 + +# imported icon images diff --git a/resources/fonts/RobotoCondensed_7.fnt b/resources/fonts/RobotoCondensed_7.fnt new file mode 100644 index 0000000..d25dae1 --- /dev/null +++ b/resources/fonts/RobotoCondensed_7.fnt @@ -0,0 +1,13 @@ +info face="Roboto Condensed" size=12 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0 +common lineHeight=13 base=10 scaleW=32 scaleH=32 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="RobotoCondensed_7.png" +chars count=9 +char id=67 x=16 y=0 width=6 height=7 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=15 +char id=70 x=23 y=0 width=5 height=7 xoffset=0 yoffset=3 xadvance=5 page=0 chnl=15 +char id=98 x=0 y=0 width=5 height=8 xoffset=0 yoffset=2 xadvance=5 page=0 chnl=15 +char id=99 x=13 y=9 width=5 height=5 xoffset=0 yoffset=5 xadvance=5 page=0 chnl=15 +char id=102 x=12 y=0 width=3 height=8 xoffset=0 yoffset=2 xadvance=3 page=0 chnl=15 +char id=105 x=29 y=0 width=2 height=7 xoffset=0 yoffset=3 xadvance=2 page=0 chnl=15 +char id=107 x=6 y=0 width=5 height=8 xoffset=0 yoffset=2 xadvance=5 page=0 chnl=15 +char id=109 x=4 y=9 width=8 height=5 xoffset=0 yoffset=5 xadvance=8 page=0 chnl=15 +char id=116 x=0 y=9 width=3 height=6 xoffset=0 yoffset=4 xadvance=3 page=0 chnl=15 diff --git a/resources/fonts/RobotoCondensed_7.png b/resources/fonts/RobotoCondensed_7.png new file mode 100644 index 0000000..979d524 Binary files /dev/null and b/resources/fonts/RobotoCondensed_7.png differ diff --git a/resources/fonts/RobotoCondensed_72.bmfc b/resources/fonts/RobotoCondensed_72.bmfc new file mode 100644 index 0000000..08e91d1 --- /dev/null +++ b/resources/fonts/RobotoCondensed_72.bmfc @@ -0,0 +1,55 @@ +# AngelCode Bitmap Font Generator configuration file +fileVersion=1 + +# font settings +fontName=Roboto Condensed +fontFile= +charSet=0 +fontSize=8 +aa=1 +scaleH=100 +useSmoothing=1 +isBold=0 +isItalic=0 +useUnicode=1 +disableBoxChars=1 +outputInvalidCharGlyph=0 +dontIncludeKerningPairs=0 +useHinting=1 +renderFromOutline=1 +useClearType=1 + +# character alignment +paddingDown=0 +paddingUp=0 +paddingRight=0 +paddingLeft=0 +spacingHoriz=1 +spacingVert=1 +useFixedHeight=0 +forceZero=0 + +# output file +outWidth=32 +outHeight=32 +outBitDepth=8 +fontDescFormat=0 +fourChnlPacked=0 +textureFormat=png +textureCompression=0 +alphaChnl=0 +redChnl=0 +greenChnl=0 +blueChnl=0 +invA=0 +invR=0 +invG=0 +invB=0 + +# outline +outlineThickness=0 + +# selected chars +chars=70,98-99,102,105,107,109,116 + +# imported icon images diff --git a/resources/fonts/RobotoCondensed_72.fnt b/resources/fonts/RobotoCondensed_72.fnt new file mode 100644 index 0000000..abbd8fc --- /dev/null +++ b/resources/fonts/RobotoCondensed_72.fnt @@ -0,0 +1,15 @@ +info face="Roboto Condensed" size=72 bold=1 italic=0 charset="" unicode=1 stretchH=110 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0 +common lineHeight=80 base=63 scaleW=160 scaleH=128 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="RobotoCondensed_72.png" +chars count=11 +char id=48 x=28 y=0 width=26 height=49 xoffset=2 yoffset=15 xadvance=30 page=0 chnl=15 +char id=49 x=137 y=0 width=17 height=47 xoffset=4 yoffset=16 xadvance=30 page=0 chnl=15 +char id=50 x=82 y=0 width=27 height=48 xoffset=1 yoffset=15 xadvance=30 page=0 chnl=15 +char id=51 x=0 y=0 width=27 height=49 xoffset=1 yoffset=15 xadvance=30 page=0 chnl=15 +char id=52 x=54 y=50 width=28 height=47 xoffset=1 yoffset=16 xadvance=30 page=0 chnl=15 +char id=53 x=110 y=0 width=26 height=48 xoffset=2 yoffset=16 xadvance=30 page=0 chnl=15 +char id=54 x=0 y=50 width=26 height=48 xoffset=2 yoffset=16 xadvance=30 page=0 chnl=15 +char id=55 x=83 y=49 width=27 height=47 xoffset=1 yoffset=16 xadvance=30 page=0 chnl=15 +char id=56 x=55 y=0 width=26 height=49 xoffset=2 yoffset=15 xadvance=30 page=0 chnl=15 +char id=57 x=27 y=50 width=26 height=48 xoffset=2 yoffset=15 xadvance=30 page=0 chnl=15 +char id=58 x=111 y=49 width=11 height=36 xoffset=3 yoffset=27 xadvance=16 page=0 chnl=15 diff --git a/resources/fonts/RobotoCondensed_72.png b/resources/fonts/RobotoCondensed_72.png new file mode 100644 index 0000000..947d1bb Binary files /dev/null and b/resources/fonts/RobotoCondensed_72.png differ diff --git a/resources/fonts/Roboto_26.fnt b/resources/fonts/Roboto_26.fnt new file mode 100644 index 0000000..145161b --- /dev/null +++ b/resources/fonts/Roboto_26.fnt @@ -0,0 +1,214 @@ +info face="Roboto" size=26 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0 +common lineHeight=26 base=21 scaleW=512 scaleH=512 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="Roboto_26.png" +chars count=95 +char id=32 x=16 y=22 width=1 height=1 xoffset=0 yoffset=0 xadvance=5 page=0 chnl=15 +char id=33 x=228 y=17 width=4 height=16 xoffset=1 yoffset=5 xadvance=6 page=0 chnl=15 +char id=34 x=497 y=17 width=5 height=6 xoffset=1 yoffset=4 xadvance=7 page=0 chnl=15 +char id=35 x=462 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=36 x=16 y=0 width=11 height=21 xoffset=1 yoffset=2 xadvance=12 page=0 chnl=15 +char id=37 x=218 y=0 width=15 height=16 xoffset=1 yoffset=5 xadvance=16 page=0 chnl=15 +char id=38 x=448 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=39 x=503 y=17 width=2 height=6 xoffset=1 yoffset=4 xadvance=4 page=0 chnl=15 +char id=40 x=0 y=0 width=7 height=23 xoffset=1 yoffset=3 xadvance=8 page=0 chnl=15 +char id=41 x=8 y=0 width=7 height=23 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=15 +char id=42 x=451 y=17 width=10 height=10 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15 +char id=43 x=254 y=17 width=12 height=13 xoffset=0 yoffset=8 xadvance=12 page=0 chnl=15 +char id=44 x=506 y=17 width=4 height=5 xoffset=0 yoffset=19 xadvance=4 page=0 chnl=15 +char id=45 x=18 y=41 width=6 height=3 xoffset=0 yoffset=14 xadvance=6 page=0 chnl=15 +char id=46 x=25 y=41 width=3 height=2 xoffset=1 yoffset=19 xadvance=6 page=0 chnl=15 +char id=47 x=157 y=0 width=9 height=17 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15 +char id=48 x=52 y=22 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=49 x=503 y=0 width=7 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=50 x=26 y=22 width=12 height=16 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=51 x=76 y=21 width=11 height=16 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=52 x=13 y=24 width=12 height=16 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=53 x=112 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=54 x=148 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=55 x=490 y=0 width=12 height=16 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=56 x=124 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=57 x=184 y=17 width=10 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=58 x=425 y=17 width=3 height=12 xoffset=1 yoffset=9 xadvance=5 page=0 chnl=15 +char id=59 x=249 y=17 width=4 height=15 xoffset=0 yoffset=9 xadvance=5 page=0 chnl=15 +char id=60 x=440 y=17 width=10 height=11 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=15 +char id=61 x=472 y=17 width=10 height=7 xoffset=1 yoffset=11 xadvance=12 page=0 chnl=15 +char id=62 x=429 y=17 width=10 height=11 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=63 x=195 y=17 width=10 height=16 xoffset=0 yoffset=5 xadvance=10 page=0 chnl=15 +char id=64 x=57 y=0 width=18 height=20 xoffset=1 yoffset=6 xadvance=20 page=0 chnl=15 +char id=65 x=234 y=0 width=14 height=16 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=15 +char id=66 x=0 y=24 width=12 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=67 x=322 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=68 x=392 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=69 x=160 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=13 page=0 chnl=15 +char id=70 x=172 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=71 x=294 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=15 page=0 chnl=15 +char id=72 x=350 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=16 page=0 chnl=15 +char id=73 x=233 y=17 width=3 height=16 xoffset=1 yoffset=5 xadvance=6 page=0 chnl=15 +char id=74 x=64 y=21 width=11 height=16 xoffset=0 yoffset=5 xadvance=12 page=0 chnl=15 +char id=75 x=364 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=76 x=100 y=18 width=11 height=16 xoffset=1 yoffset=5 xadvance=12 page=0 chnl=15 +char id=77 x=200 y=0 width=17 height=16 xoffset=1 yoffset=5 xadvance=19 page=0 chnl=15 +char id=78 x=249 y=0 width=14 height=16 xoffset=1 yoffset=5 xadvance=16 page=0 chnl=15 +char id=79 x=406 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=15 page=0 chnl=15 +char id=80 x=378 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=81 x=82 y=0 width=13 height=19 xoffset=1 yoffset=5 xadvance=15 page=0 chnl=15 +char id=82 x=336 y=0 width=13 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=83 x=308 y=0 width=13 height=16 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=15 +char id=84 x=420 y=0 width=13 height=16 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=15 +char id=85 x=39 y=22 width=12 height=16 xoffset=1 yoffset=5 xadvance=14 page=0 chnl=15 +char id=86 x=264 y=0 width=14 height=16 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=15 +char id=87 x=180 y=0 width=19 height=16 xoffset=0 yoffset=5 xadvance=20 page=0 chnl=15 +char id=88 x=279 y=0 width=14 height=16 xoffset=0 yoffset=5 xadvance=14 page=0 chnl=15 +char id=89 x=434 y=0 width=13 height=16 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=15 +char id=90 x=476 y=0 width=13 height=16 xoffset=0 yoffset=5 xadvance=13 page=0 chnl=15 +char id=91 x=51 y=0 width=5 height=21 xoffset=1 yoffset=3 xadvance=6 page=0 chnl=15 +char id=92 x=147 y=0 width=9 height=17 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15 +char id=93 x=45 y=0 width=5 height=21 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=15 +char id=94 x=462 y=17 width=9 height=9 xoffset=0 yoffset=5 xadvance=9 page=0 chnl=15 +char id=95 x=7 y=41 width=10 height=3 xoffset=0 yoffset=20 xadvance=10 page=0 chnl=15 +char id=96 x=0 y=41 width=6 height=4 xoffset=0 yoffset=5 xadvance=7 page=0 chnl=15 +char id=97 x=407 y=17 width=10 height=12 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=98 x=112 y=0 width=11 height=17 xoffset=1 yoffset=4 xadvance=12 page=0 chnl=15 +char id=99 x=363 y=17 width=10 height=12 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=100 x=100 y=0 width=11 height=17 xoffset=0 yoffset=4 xadvance=12 page=0 chnl=15 +char id=101 x=374 y=17 width=10 height=12 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=102 x=167 y=0 width=8 height=17 xoffset=0 yoffset=4 xadvance=8 page=0 chnl=15 +char id=103 x=88 y=20 width=11 height=16 xoffset=0 yoffset=9 xadvance=12 page=0 chnl=15 +char id=104 x=136 y=0 width=10 height=17 xoffset=1 yoffset=4 xadvance=12 page=0 chnl=15 +char id=105 x=237 y=17 width=3 height=16 xoffset=1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=106 x=76 y=0 width=5 height=20 xoffset=-1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=107 x=124 y=0 width=11 height=17 xoffset=1 yoffset=4 xadvance=11 page=0 chnl=15 +char id=108 x=176 y=0 width=3 height=17 xoffset=1 yoffset=4 xadvance=5 page=0 chnl=15 +char id=109 x=267 y=17 width=17 height=12 xoffset=1 yoffset=9 xadvance=19 page=0 chnl=15 +char id=110 x=385 y=17 width=10 height=12 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=111 x=303 y=17 width=11 height=12 xoffset=1 yoffset=9 xadvance=13 page=0 chnl=15 +char id=112 x=136 y=18 width=11 height=16 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=113 x=206 y=17 width=10 height=16 xoffset=1 yoffset=9 xadvance=13 page=0 chnl=15 +char id=114 x=418 y=17 width=6 height=12 xoffset=1 yoffset=9 xadvance=7 page=0 chnl=15 +char id=115 x=315 y=17 width=11 height=12 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=15 +char id=116 x=241 y=17 width=7 height=15 xoffset=0 yoffset=6 xadvance=7 page=0 chnl=15 +char id=117 x=396 y=17 width=10 height=12 xoffset=1 yoffset=9 xadvance=12 page=0 chnl=15 +char id=118 x=327 y=17 width=11 height=12 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=15 +char id=119 x=285 y=17 width=17 height=12 xoffset=0 yoffset=9 xadvance=17 page=0 chnl=15 +char id=120 x=339 y=17 width=11 height=12 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=15 +char id=121 x=217 y=17 width=10 height=16 xoffset=0 yoffset=9 xadvance=10 page=0 chnl=15 +char id=122 x=351 y=17 width=11 height=12 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=15 +char id=123 x=37 y=0 width=7 height=21 xoffset=0 yoffset=4 xadvance=7 page=0 chnl=15 +char id=124 x=96 y=0 width=3 height=19 xoffset=1 yoffset=5 xadvance=5 page=0 chnl=15 +char id=125 x=28 y=0 width=8 height=21 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=15 +char id=126 x=483 y=17 width=13 height=6 xoffset=1 yoffset=12 xadvance=15 page=0 chnl=15 +kernings count=114 +kerning first=34 second=99 amount=-1 +kerning first=34 second=100 amount=-1 +kerning first=34 second=101 amount=-1 +kerning first=34 second=103 amount=-1 +kerning first=34 second=113 amount=-1 +kerning first=34 second=111 amount=-1 +kerning first=34 second=65 amount=-1 +kerning first=34 second=97 amount=-1 +kerning first=34 second=115 amount=-1 +kerning first=34 second=34 amount=-1 +kerning first=34 second=39 amount=-1 +kerning first=39 second=99 amount=-1 +kerning first=39 second=100 amount=-1 +kerning first=39 second=101 amount=-1 +kerning first=39 second=103 amount=-1 +kerning first=39 second=113 amount=-1 +kerning first=39 second=111 amount=-1 +kerning first=39 second=65 amount=-1 +kerning first=39 second=97 amount=-1 +kerning first=39 second=115 amount=-1 +kerning first=39 second=34 amount=-1 +kerning first=39 second=39 amount=-1 +kerning first=44 second=34 amount=-2 +kerning first=44 second=39 amount=-2 +kerning first=46 second=34 amount=-2 +kerning first=46 second=39 amount=-2 +kerning first=65 second=118 amount=-1 +kerning first=65 second=121 amount=-1 +kerning first=65 second=84 amount=-1 +kerning first=65 second=89 amount=-1 +kerning first=65 second=34 amount=-1 +kerning first=65 second=39 amount=-1 +kerning first=65 second=87 amount=-1 +kerning first=65 second=86 amount=-1 +kerning first=66 second=89 amount=-1 +kerning first=68 second=44 amount=-1 +kerning first=68 second=46 amount=-1 +kerning first=75 second=45 amount=-1 +kerning first=76 second=67 amount=-1 +kerning first=76 second=71 amount=-1 +kerning first=76 second=79 amount=-1 +kerning first=76 second=81 amount=-1 +kerning first=76 second=118 amount=-1 +kerning first=76 second=121 amount=-1 +kerning first=76 second=85 amount=-1 +kerning first=76 second=84 amount=-3 +kerning first=76 second=89 amount=-3 +kerning first=76 second=34 amount=-4 +kerning first=76 second=39 amount=-4 +kerning first=76 second=87 amount=-2 +kerning first=76 second=86 amount=-2 +kerning first=79 second=44 amount=-1 +kerning first=79 second=46 amount=-1 +kerning first=80 second=65 amount=-1 +kerning first=80 second=44 amount=-3 +kerning first=80 second=46 amount=-3 +kerning first=80 second=74 amount=-2 +kerning first=84 second=99 amount=-1 +kerning first=84 second=100 amount=-1 +kerning first=84 second=101 amount=-1 +kerning first=84 second=103 amount=-1 +kerning first=84 second=113 amount=-1 +kerning first=84 second=109 amount=-1 +kerning first=84 second=110 amount=-1 +kerning first=84 second=112 amount=-1 +kerning first=84 second=111 amount=-1 +kerning first=84 second=117 amount=-1 +kerning first=84 second=65 amount=-1 +kerning first=84 second=97 amount=-1 +kerning first=84 second=118 amount=-1 +kerning first=84 second=121 amount=-1 +kerning first=84 second=115 amount=-1 +kerning first=84 second=122 amount=-1 +kerning first=84 second=120 amount=-1 +kerning first=84 second=44 amount=-2 +kerning first=84 second=46 amount=-2 +kerning first=84 second=45 amount=-2 +kerning first=84 second=74 amount=-3 +kerning first=86 second=65 amount=-1 +kerning first=86 second=44 amount=-2 +kerning first=86 second=46 amount=-2 +kerning first=87 second=44 amount=-1 +kerning first=87 second=46 amount=-1 +kerning first=87 second=45 amount=-1 +kerning first=89 second=99 amount=-1 +kerning first=89 second=100 amount=-1 +kerning first=89 second=101 amount=-1 +kerning first=89 second=103 amount=-1 +kerning first=89 second=113 amount=-1 +kerning first=89 second=111 amount=-1 +kerning first=89 second=65 amount=-1 +kerning first=89 second=97 amount=-1 +kerning first=89 second=85 amount=-1 +kerning first=89 second=115 amount=-1 +kerning first=89 second=44 amount=-2 +kerning first=89 second=46 amount=-2 +kerning first=89 second=45 amount=-1 +kerning first=89 second=74 amount=-1 +kerning first=97 second=34 amount=-1 +kerning first=97 second=39 amount=-1 +kerning first=104 second=34 amount=-1 +kerning first=104 second=39 amount=-1 +kerning first=109 second=34 amount=-1 +kerning first=109 second=39 amount=-1 +kerning first=110 second=34 amount=-1 +kerning first=110 second=39 amount=-1 +kerning first=111 second=34 amount=-1 +kerning first=111 second=39 amount=-1 +kerning first=114 second=44 amount=-1 +kerning first=114 second=46 amount=-1 +kerning first=118 second=44 amount=-1 +kerning first=118 second=46 amount=-1 +kerning first=121 second=44 amount=-1 +kerning first=121 second=46 amount=-1 diff --git a/resources/fonts/Roboto_26.png b/resources/fonts/Roboto_26.png new file mode 100644 index 0000000..d04bffd Binary files /dev/null and b/resources/fonts/Roboto_26.png differ diff --git a/resources/resources.xml b/resources/resources.xml index f405868..5889895 100644 --- a/resources/resources.xml +++ b/resources/resources.xml @@ -1,5 +1,5 @@ - Digital5 + Digital5Reloaded 000000 @@ -11,7 +11,12 @@ - + + + + + + - \ No newline at end of file + diff --git a/resources/settings/properties.xml b/resources/settings/properties.xml index c91646f..576d4f0 100644 --- a/resources/settings/properties.xml +++ b/resources/settings/properties.xml @@ -12,12 +12,11 @@ true true - - true - + + false false - 3600 + true 0 diff --git a/resources/settings/settings.xml b/resources/settings/settings.xml index 4eb9397..ba596fb 100644 --- a/resources/settings/settings.xml +++ b/resources/settings/settings.xml @@ -72,7 +72,7 @@ - + @@ -80,6 +80,10 @@ + + + + @@ -264,11 +268,12 @@ - @Strings.Calories + @Strings.Steps + @Strings.Calories @Strings.ActiveCalories @Strings.HeartRate @Strings.Distance - @Strings.Altitude + @Strings.Altitude @Strings.Pressure @Strings.ActiveTimeDay @Strings.ActiveTimeWeek diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml index 8efef0d..2f10d88 100644 --- a/resources/strings/strings.xml +++ b/resources/strings/strings.xml @@ -1,6 +1,6 @@ - + Gender Female @@ -43,9 +43,10 @@ Bigger battery font - Daylight Saving Time + Daylight Saving Time (home location) - Show Home Timezone + Show Home Time + Show Home Date Timezone (home location) diff --git a/source/Digital5App.mc b/source/Digital5App.mc index edee2be..e1dc2c0 100644 --- a/source/Digital5App.mc +++ b/source/Digital5App.mc @@ -5,7 +5,18 @@ using Toybox.System; using Toybox.Time; using Toybox.Time.Gregorian; -class Digital5App extends App.AppBase { +var debug = true; + + function Log(method, message){ + if ($.debug){ + + var myTime = System.getClockTime(); + var myTimeString = myTime.hour.format("%02d") + ":" + myTime.min.format("%02d") + ":" + myTime.sec.format("%02d"); + if ($.debug) {System.println(myTimeString + " | " + method + " | " + message);} + } + } + +class Digital5ReloadedApp extends App.AppBase { hidden var view; hidden var sunRiseSet; @@ -41,14 +52,16 @@ class Digital5App extends App.AppBase { } function onBackgroundData(data) { + Log("Digital5ServiceDelegate.onBackgroundData","data: " + data); + if (data instanceof Dictionary) { var msg = data.get("msg"); - if (msg.equals("FAIL") || msg.equals("WRONG KEY")) { - } else if (msg.equals("CURRENTLY")) { + App.getApp().setProperty("dsResult", msg); + if (msg.equals("CURRENTLY")) { App.getApp().setProperty("temp", data.get("temp")); } else if (msg.equals("DAILY")) { - App.getApp().setProperty("tempMin", data.get("tempMin")); - App.getApp().setProperty("tempMax", data.get("tempMax")); + App.getApp().setProperty("minTemp", data.get("minTemp")); + App.getApp().setProperty("maxTemp", data.get("maxTemp")); } // rain, snow, sleet, wind, fog, cloudy var icon = data.get("icon"); @@ -71,6 +84,8 @@ class Digital5App extends App.AppBase { } else { App.getApp().setProperty("icon", 7); } + + WatchUi.requestUpdate(); } } diff --git a/source/Digital5ServiceDelegate.mc b/source/Digital5ServiceDelegate.mc index f81581f..757ce09 100644 --- a/source/Digital5ServiceDelegate.mc +++ b/source/Digital5ServiceDelegate.mc @@ -14,6 +14,7 @@ class Digital5ServiceDelegate extends System.ServiceDelegate { var apiKey = App.getApp().getProperty("DarkSkyApiKey"); var lat = App.getApp().getProperty("UserLat").toFloat(); var lng = App.getApp().getProperty("UserLng").toFloat(); + if (System.getDeviceSettings().phoneConnected && apiKey.length() > 0 && (null != lat && null != lng)) { @@ -37,13 +38,17 @@ class Digital5ServiceDelegate extends System.ServiceDelegate { :headers => { "Content-Type" => Comm.REQUEST_CONTENT_TYPE_JSON }, :responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_JSON }; + + if ($.debug) {System.println("Digital5ServiceDelegate.makeRequest - url: " + url + ", params: " + params);} + Comm.makeWebRequest(url, params, options, method(:onReceive)); } function onReceive(responseCode, data) { + if ($.debug) {System.println("Digital5ServiceDelegate.onReceive - responseCode: " + responseCode + ", data: " + data);} if (responseCode == 200) { if (data instanceof Lang.String && data.equals("Forbidden")) { - var dict = { "msg" => "WRONG KEY" }; + var dict = { "msg" => "KEY" }; Background.exit(dict); } else { var currentWeather = App.getApp().getProperty("CurrentWeather"); @@ -69,7 +74,7 @@ class Digital5ServiceDelegate extends System.ServiceDelegate { } } } else { - var dict = { "msg" => "FAIL" }; + var dict = { "msg" => responseCode + " FAIL" }; Background.exit(dict); } } diff --git a/source/Digital5View.mc b/source/Digital5View.mc index 5936a86..9e2d59d 100644 --- a/source/Digital5View.mc +++ b/source/Digital5View.mc @@ -13,20 +13,43 @@ using Toybox.Ant as Ant; using Toybox.SensorHistory as Sensor; - class Digital5View extends Ui.WatchFace { + var is24Hour; var secondsAlwaysOn; - var lcdFont; + var lcdFont; var lcdFontDataFields; var showLeadingZero; var clockTime; var sunRiseSet; - enum { WOMAN, MEN } - enum { UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT, BOTTOM_FIELD } - enum { M, I, K, B, C, F, T } - enum { KCAL, ACTIVE_KCAL, ACTIVE_KCAL_REACHED } + enum { + WOMAN = 0, + MEN = 1 + } + + enum { + UPPER_LEFT = 0, + UPPER_RIGHT = 1, + LOWER_LEFT = 2, + LOWER_RIGHT = 3, + BOTTOM_FIELD = 4 + } + + enum { + M = 0, + I = 1, + K = 2, + B = 3, + C = 4, + F = 5, + T = 6 + } + enum { + KCAL = 0, + ACTIVE_KCAL = 1, + ACTIVE_KCAL_REACHED = 2 + } const BRIGHT_BLUE = 0x0055ff; const BRIGHT_GREEN = 0x55ff00; const BRIGHT_RED = 0xff0055; @@ -41,10 +64,14 @@ class Digital5View extends Ui.WatchFace { var sunsetText = "--:--"; var currentWeather; var digitalUpright72, digitalUpright26, digitalUpright24, digitalUpright20, digitalUpright16; + var robotoCondensed72, robotoCondensed24, roboto26, robotoCondensed7, robotoCondensed20; var burnedIcon, burnedIconWhite, stepsIcon, stepsIconWhite; - + var alarmIcon, alarmIconWhite; var width, height; var centerX, centerY; + var upperFieldHeightPercentage, fieldHeightPercentage; + var dataFieldsTop, dataFieldsTopPadding; + var fieldHeight; var midnightInfo; var nowinfo; var actinfo; @@ -55,16 +82,29 @@ class Digital5View extends Ui.WatchFace { var bpm, showBpmZones, maxBpm, currentZone; var distanceUnit, distance; var tempUnit; - var altUnit; - var coloredStepText; + var batteryIconOffsetX; + var coloredCalorieText; var upperLeftField, upperRightField, lowerLeftField, lowerRightField, bottomField; var darkUpperBackground, upperBackgroundColor, upperForegroundColor; var darkFieldBackground, fieldBackgroundColor, fieldForegroundColor; - var deviceName, apiKey; + var apiKey; + var secondsFont = 0; + var secondsYPosition = 0; + + var timeFont; + var dateTimeFont; + var amPmFont; function initialize() { WatchFace.initialize(); + + //reset weather data + //App.getApp().setProperty("dsResult", ""); + //App.getApp().setProperty("temp", ""); + //App.getApp().setProperty("minTemp", ""); + //App.getApp().setProperty("maxTemp", ""); + } function onLayout(dc) { @@ -73,52 +113,84 @@ class Digital5View extends Ui.WatchFace { digitalUpright24 = Ui.loadResource(Rez.Fonts.digitalUpright24); digitalUpright20 = Ui.loadResource(Rez.Fonts.digitalUpright20); digitalUpright16 = Ui.loadResource(Rez.Fonts.digitalUpright16); - burnedIcon = Ui.loadResource(Rez.Drawables.burned); - burnedIconWhite = Ui.loadResource(Rez.Drawables.burnedWhite); - stepsIcon = Ui.loadResource(Rez.Drawables.steps); - stepsIconWhite = Ui.loadResource(Rez.Drawables.stepsWhite); - weekdays[0] = Ui.loadResource(Rez.Strings.Sun); - weekdays[1] = Ui.loadResource(Rez.Strings.Mon); - weekdays[2] = Ui.loadResource(Rez.Strings.Tue); - weekdays[3] = Ui.loadResource(Rez.Strings.Wed); - weekdays[4] = Ui.loadResource(Rez.Strings.Thu); - weekdays[5] = Ui.loadResource(Rez.Strings.Fri); - weekdays[6] = Ui.loadResource(Rez.Strings.Sat); - months[0] = Ui.loadResource(Rez.Strings.Jan); - months[1] = Ui.loadResource(Rez.Strings.Feb); - months[2] = Ui.loadResource(Rez.Strings.Mar); - months[3] = Ui.loadResource(Rez.Strings.Apr); - months[4] = Ui.loadResource(Rez.Strings.May); - months[5] = Ui.loadResource(Rez.Strings.Jun); - months[6] = Ui.loadResource(Rez.Strings.Jul); - months[7] = Ui.loadResource(Rez.Strings.Aug); - months[8] = Ui.loadResource(Rez.Strings.Sep); - months[9] = Ui.loadResource(Rez.Strings.Oct); - months[10] = Ui.loadResource(Rez.Strings.Nov); - months[11] = Ui.loadResource(Rez.Strings.Dec); - deviceName = getDeviceName(); + robotoCondensed72 = Ui.loadResource(Rez.Fonts.robotoCondensed72); + roboto26 = Ui.loadResource(Rez.Fonts.roboto26); + robotoCondensed24 = Ui.loadResource(Rez.Fonts.robotoCondensed24); + robotoCondensed7 = Ui.loadResource(Rez.Fonts.robotoCondensed7); + robotoCondensed20 = Ui.loadResource(Rez.Fonts.robotoCondensed20); + burnedIcon = Ui.loadResource(Rez.Drawables.burned); + burnedIconWhite = Ui.loadResource(Rez.Drawables.burnedWhite); + stepsIcon = Ui.loadResource(Rez.Drawables.steps); + stepsIconWhite = Ui.loadResource(Rez.Drawables.stepsWhite); + weekdays[0] = Ui.loadResource(Rez.Strings.Sun); + weekdays[1] = Ui.loadResource(Rez.Strings.Mon); + weekdays[2] = Ui.loadResource(Rez.Strings.Tue); + weekdays[3] = Ui.loadResource(Rez.Strings.Wed); + weekdays[4] = Ui.loadResource(Rez.Strings.Thu); + weekdays[5] = Ui.loadResource(Rez.Strings.Fri); + weekdays[6] = Ui.loadResource(Rez.Strings.Sat); + months[0] = Ui.loadResource(Rez.Strings.Jan); + months[1] = Ui.loadResource(Rez.Strings.Feb); + months[2] = Ui.loadResource(Rez.Strings.Mar); + months[3] = Ui.loadResource(Rez.Strings.Apr); + months[4] = Ui.loadResource(Rez.Strings.May); + months[5] = Ui.loadResource(Rez.Strings.Jun); + months[6] = Ui.loadResource(Rez.Strings.Jul); + months[7] = Ui.loadResource(Rez.Strings.Aug); + months[8] = Ui.loadResource(Rez.Strings.Sep); + months[9] = Ui.loadResource(Rez.Strings.Oct); + months[10] = Ui.loadResource(Rez.Strings.Nov); + months[11] = Ui.loadResource(Rez.Strings.Dec); + + width = dc.getWidth(); + height = dc.getHeight(); + centerX = width * 0.5; + centerY = height * 0.5; + batteryIconOffsetX = 0; + upperFieldHeightPercentage = 0.625; + dataFieldsTop = height * upperFieldHeightPercentage; + dataFieldsTopPadding = 7; + fieldHeightPercentage = 0.125; + fieldHeight = fieldHeightPercentage * height; + + distanceUnit = Sys.getDeviceSettings().distanceUnits; + + Log("Digital5View.onLayout","width: " + width + ", height: " + height); + } function onUpdate(dc) { View.onUpdate(dc); - + dc.clearClip(); is24Hour = Sys.getDeviceSettings().is24Hour; secondsAlwaysOn = App.getApp().getProperty("SecondsAlwaysOn"); - lcdFont = App.getApp().getProperty("LcdFont"); + lcdFont = App.getApp().getProperty("LcdFont"); lcdFontDataFields = App.getApp().getProperty("LcdFontDataFields"); showLeadingZero = App.getApp().getProperty("ShowLeadingZero"); + tempUnit = App.getApp().getProperty("TempUnit"); + coloredCalorieText = App.getApp().getProperty("ColorizeCalorieText"); + upperLeftField = App.getApp().getProperty("UpperLeftField").toNumber(); + upperRightField = App.getApp().getProperty("UpperRightField").toNumber(); + lowerLeftField = App.getApp().getProperty("LowerLeftField").toNumber(); + lowerRightField = App.getApp().getProperty("LowerRightField").toNumber(); + bottomField = App.getApp().getProperty("BottomField").toNumber(); + darkUpperBackground = App.getApp().getProperty("DarkUpperBackground"); + upperBackgroundColor = darkUpperBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE; + upperForegroundColor = darkUpperBackground ? Gfx.COLOR_WHITE : Gfx.COLOR_BLACK; + darkFieldBackground = App.getApp().getProperty("DarkFieldBackground"); + fieldBackgroundColor = darkFieldBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE; + fieldForegroundColor = darkFieldBackground ? Gfx.COLOR_WHITE : Gfx.COLOR_BLACK; + apiKey = App.getApp().getProperty("DarkSkyApiKey"); + showBpmZones = App.getApp().getProperty("BpmZones"); clockTime = Sys.getClockTime(); sunRiseSet = new SunRiseSunSet(); currentWeather = App.getApp().getProperty("CurrentWeather"); + var showMoveBar = App.getApp().getProperty("ShowMoveBar"); // General - width = dc.getWidth(); - height = dc.getHeight(); - centerX = width * 0.5; - centerY = height * 0.5; midnightInfo = Greg.info(Time.today(), Time.FORMAT_SHORT); nowinfo = Greg.info(Time.now(), Time.FORMAT_SHORT); actinfo = Act.getInfo(); @@ -131,53 +203,27 @@ class Digital5View extends Ui.WatchFace { stepsReached = steps.toDouble() / stepGoal; kcal = actinfo.calories; bpm = (hr.heartRate != Act.INVALID_HR_SAMPLE && hr.heartRate > 0) ? hr.heartRate : 0; - showBpmZones = App.getApp().getProperty("BpmZones"); - distanceUnit = Sys.getDeviceSettings().distanceUnits; - tempUnit = App.getApp().getProperty("TempUnit"); - altUnit = App.getApp().getProperty("AltUnit"); distance = distanceUnit == 0 ? actinfo.distance * 0.00001 : actinfo.distance * 0.00001 * 0.621371; - coloredStepText = App.getApp().getProperty("ColorizeStepText"); - coloredCalorieText = App.getApp().getProperty("ColorizeCalorieText"); - upperLeftField = App.getApp().getProperty("UpperLeftField").toNumber(); - upperRightField = App.getApp().getProperty("UpperRightField").toNumber(); - lowerLeftField = App.getApp().getProperty("LowerLeftField").toNumber(); - lowerRightField = App.getApp().getProperty("LowerRightField").toNumber(); - bottomField = App.getApp().getProperty("BottomField").toNumber(); - darkUpperBackground = App.getApp().getProperty("DarkUpperBackground"); - upperBackgroundColor = darkUpperBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE; - upperForegroundColor = darkUpperBackground ? Gfx.COLOR_WHITE : Gfx.COLOR_BLACK; - darkFieldBackground = App.getApp().getProperty("DarkFieldBackground"); - fieldBackgroundColor = darkFieldBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE; - fieldForegroundColor = darkFieldBackground ? Gfx.COLOR_WHITE : Gfx.COLOR_BLACK; - apiKey = App.getApp().getProperty("DarkSkyApiKey"); - var charge = systemStats.battery + 0.5; - var showChargePercentage = App.getApp().getProperty("ShowChargePercentage"); - var showPercentageUnder20 = App.getApp().getProperty("ShowPercentageUnder20"); - var dayOfWeek = nowinfo.day_of_week; var lcdBackgroundVisible = App.getApp().getProperty("LcdBackground"); - var connected = Sys.getDeviceSettings().phoneConnected; var profile = UserProfile.getProfile(); - var notificationCount = Sys.getDeviceSettings().notificationCount; - var alarmCount = Sys.getDeviceSettings().alarmCount; var dst = App.getApp().getProperty("DST"); var timezoneOffset = clockTime.timeZoneOffset; var showHomeTimezone = App.getApp().getProperty("ShowHomeTimezone"); var homeTimezoneOffset = dst ? App.getApp().getProperty("HomeTimezoneOffset") + 3600 : App.getApp().getProperty("HomeTimezoneOffset"); - var onTravel = timezoneOffset != homeTimezoneOffset; + var onTravel = (timezoneOffset != homeTimezoneOffset) && showHomeTimezone; + var dayOfWeek = nowinfo.day_of_week; var dayMonth = App.getApp().getProperty("DateFormat") == 0; var dateFormat = dayMonth ? "$1$.$2$" : "$2$/$1$"; var monthAsText = App.getApp().getProperty("MonthAsText"); var showCalendarWeek = App.getApp().getProperty("ShowCalendarWeek"); - var showMoveBar = App.getApp().getProperty("ShowMoveBar"); var showStepBar = App.getApp().getProperty("ShowStepBar"); var showCalorieBar = App.getApp().getProperty("ShowCalorieBar"); var hourColor = App.getApp().getProperty("HourColor").toNumber(); var minuteColor = App.getApp().getProperty("MinuteColor").toNumber(); - var coloredBattery = App.getApp().getProperty("ColoredBattery"); var showSunriseSunset = App.getApp().getProperty("SunriseSunset"); var activeKcalGoal = App.getApp().getProperty("ActiveKcalGoal").toNumber(); - var biggerBatteryFont = App.getApp().getProperty("BiggerBatteryFont"); + var gender; var userWeight; var userHeight; @@ -194,6 +240,25 @@ class Digital5View extends Ui.WatchFace { userHeight = profile.height; userAge = nowinfo.year - profile.birthYear; } + + if (hourColor == upperBackgroundColor){ + hourColor = upperForegroundColor; + } + if (minuteColor == upperBackgroundColor){ + minuteColor = upperForegroundColor; + } + + if (lcdFont) { + timeFont = digitalUpright72 ; + dateTimeFont = digitalUpright26; + amPmFont = digitalUpright20; + } + else { + timeFont = robotoCondensed72 ; + dateTimeFont = roboto26; + amPmFont = robotoCondensed24; + } + // Mifflin-St.Jeor Formula (1990) var baseKcalMen = (9.99 * userWeight) + (6.25 * userHeight) - (4.92 * userAge) + 5.0; // base kcal men @@ -227,72 +292,74 @@ class Digital5View extends Ui.WatchFace { // Draw Background dc.setPenWidth(1); dc.setColor(upperBackgroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 0, width, 151); + dc.fillRectangle(0, 0, width, dataFieldsTop + 1); if (darkFieldBackground) { dc.setColor(fieldBackgroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 151, width, 89); + dc.fillRectangle(0, dataFieldsTop + 1, width, 3 * fieldHeight); dc.setColor(Gfx.COLOR_LT_GRAY, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 151, width, 2); - dc.fillRectangle(0, 180, width, 2); - dc.fillRectangle(0, 211, width, 2); - dc.fillRectangle(119, 151, 2, 60); + dc.fillRectangle(0, dataFieldsTop + 1, width, 2); // top separator line + dc.fillRectangle(0, dataFieldsTop + fieldHeight, width, 2); // middle separator line + dc.fillRectangle(0, dataFieldsTop + 2 * fieldHeight, width, 2); // bottom separator line + dc.fillRectangle(centerX - 1, dataFieldsTop + 1, 2, 2 * fieldHeight); // vertical separator line } else { dc.setColor(fieldBackgroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 151, width, 89); + dc.fillRectangle(0, dataFieldsTop + 1, width, 3 * fieldHeight); dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 149, width, 2); + dc.fillRectangle(0, dataFieldsTop - 1, width, 2); // top separator line dc.setColor(Gfx.COLOR_DK_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 151, width, 151); + dc.drawLine(0, dataFieldsTop + 1, width, dataFieldsTop + 1); // top separator line dc.setColor(Gfx.COLOR_LT_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 152, width, 152); + dc.drawLine(0, dataFieldsTop + 2, width, dataFieldsTop + 2); // top separator line shadow dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 179, width, 2); + dc.fillRectangle(0, dataFieldsTop + fieldHeight - 1, width, 2); // middle separator line dc.setColor(Gfx.COLOR_DK_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 181, width, 181); + dc.drawLine(0, dataFieldsTop + fieldHeight + 1, width, dataFieldsTop + fieldHeight + 1); // middle separator line dc.setColor(Gfx.COLOR_LT_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 182, width, 182); + dc.drawLine(0, dataFieldsTop + fieldHeight + 2, width, dataFieldsTop + fieldHeight + 2); // middle separator line shadow dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(0, 210, width, 2); + dc.fillRectangle(0, dataFieldsTop + 2 * fieldHeight, width, 2); dc.setColor(Gfx.COLOR_DK_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 212, width, 212); + dc.drawLine(0, dataFieldsTop + 2 * fieldHeight + 2, width, dataFieldsTop + 2 * fieldHeight + 2); dc.setColor(Gfx.COLOR_LT_GRAY, Gfx.COLOR_TRANSPARENT); - dc.drawLine(0, 213, width, 213); + dc.drawLine(0, dataFieldsTop + 2 * fieldHeight + 3, width, dataFieldsTop + 2 * fieldHeight + 3); dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); - dc.fillRectangle(119, 150, 2, 60); - } + dc.fillRectangle(centerX - 1, dataFieldsTop, 2, 2 * fieldHeight); // bottom field + } - if (showPercentageUnder20 and charge < 20) { showChargePercentage = true; } + // draw Battery + var biggerBatteryFont = App.getApp().getProperty("BiggerBatteryFont"); + var showChargePercentage = App.getApp().getProperty("ShowChargePercentage"); + var showPercentageUnder20 = App.getApp().getProperty("ShowPercentageUnder20"); + var charge = systemStats.battery + 0.5; + var coloredBattery = App.getApp().getProperty("ColoredBattery"); + showChargePercentage = showChargePercentage || showPercentageUnder20 && charge < 20; + + Log("Digital5View.onUpdate","(draw battery) charge: " + charge + ", showPercentageUnder20: " + showPercentageUnder20 + ", showChargePercentage: " + showChargePercentage); - var iconOffsetX; - // Battery if (showChargePercentage) { - iconOffsetX = charge < 100 ? (lcdFont ? 4 : 5) : 0; + batteryIconOffsetX = 7; // Charge Text dc.setColor(upperForegroundColor, upperBackgroundColor); - if (lcdFont) { - dc.drawText(140 - iconOffsetX, 1, digitalUpright20, charge.toNumber(), Gfx.TEXT_JUSTIFY_RIGHT); - } else { - dc.drawText(140 - iconOffsetX, -2, Graphics.FONT_XTINY, charge.toNumber(), Gfx.TEXT_JUSTIFY_RIGHT); - } + dc.drawText(centerX, 1, digitalUpright20, charge.toNumber(), Gfx.TEXT_JUSTIFY_CENTER); // Percentage Sign - dc.drawLine(142 - iconOffsetX, 16, 148 - iconOffsetX, 6); - dc.drawRectangle(142 - iconOffsetX, 7, 3, 3); - dc.drawRectangle(145 - iconOffsetX, 14, 3, 3); + dc.drawLine(centerX + 20 - batteryIconOffsetX, 16, centerX + 28 - batteryIconOffsetX, 6); + dc.drawRectangle(centerX + 20 - batteryIconOffsetX, 7, 3, 3); + dc.drawRectangle(centerX + 26 - batteryIconOffsetX, 14, 3, 3); // Vertical Battery dc.setColor(upperForegroundColor, upperBackgroundColor); - dc.drawRectangle(98 + iconOffsetX, 4, 8, 16); - dc.fillRectangle(100 + iconOffsetX, 3, 4, 1); + dc.drawRectangle(centerX - 27 + batteryIconOffsetX, 4, 8, 16); + dc.fillRectangle(centerX - 25 + batteryIconOffsetX, 3, 4, 1); if (coloredBattery) { setBatteryColor(charge, dc); @@ -300,71 +367,70 @@ class Digital5View extends Ui.WatchFace { dc.setColor(charge < 20 ? BRIGHT_RED : upperForegroundColor, upperBackgroundColor); } var chargeHeight = clamp(1, 12, 12.0 * charge / 100.0).toNumber(); - dc.fillRectangle(100 + iconOffsetX, clamp(6, 18, 18 - chargeHeight), 4, chargeHeight); + dc.fillRectangle(centerX - 25 + batteryIconOffsetX, clamp(6, 18, 18 - chargeHeight), 4, chargeHeight); } else { - iconOffsetX = lcdFont ? 4 : 5; + batteryIconOffsetX = 4; // Horizontal Battery dc.setColor(upperForegroundColor, upperBackgroundColor); - dc.drawRectangle(106, 8, 28, 11); - dc.fillRectangle(134, 11, 2, 5); + dc.drawRectangle(centerX - 14, 8, 28, 11); + dc.fillRectangle(centerX + 14, 11, 2, 5); if (coloredBattery) { setBatteryColor(charge, dc); } else { dc.setColor(charge < 20 ? BRIGHT_RED : upperForegroundColor, upperBackgroundColor); } - dc.fillRectangle(108, 10 , clamp (1, 24, 24.0 * charge / 100.0), 7); - } + dc.fillRectangle(centerX - 12, 10 , clamp (1, 24, 24.0 * charge / 100.0), 7); + } - // Notification + // draw notification + var notificationCount = Sys.getDeviceSettings().notificationCount; if (notificationCount > 0) { + var startX = centerX - 55 - batteryIconOffsetX; + var startY = 18; + + Log("Digital5View.onUpdate","(draw notification) startX: " + startX + ", startY: " + startY + ", notificationCount: " + notificationCount); + dc.setColor(darkUpperBackground ? Gfx.COLOR_WHITE : Gfx.COLOR_BLACK, upperBackgroundColor); - dc.fillRectangle(58, 18, 18, 11); + dc.fillRectangle(startX, startY, 18, 11); dc.setColor(darkUpperBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE, upperBackgroundColor); - dc.drawLine(59, 18, 67, 26); - dc.drawLine(74, 18, 66, 26); - dc.drawLine(58, 29, 64, 23); - dc.drawLine(75, 29, 69, 23); + dc.drawLine(startX + 1, startY, startX + 9, startY + 8); + dc.drawLine(startX + 16, startY, startX + 8, startY + 8); + dc.drawLine(startX, startY + 11, startX + 6, startY + 5); + dc.drawLine(startX + 17, startY + 11, startX + 11, startY + 5); } - // BLE + // draw bluetooth + var connected = Sys.getDeviceSettings().phoneConnected; if (connected) { + var startX = centerX - 30 - batteryIconOffsetX; + var startY = 12; + Log("Digital5View.onUpdate","(draw bluetooth) startX: " + startX + ", startY: " + startY + ", connected: " + connected); dc.setColor(upperForegroundColor, upperBackgroundColor); - dc.drawLine(83 + iconOffsetX, 12, 90 + iconOffsetX, 19); - dc.drawLine(90 + iconOffsetX, 19, 86 + iconOffsetX, 23); - dc.drawLine(86 + iconOffsetX, 23, 86 + iconOffsetX, 10); - dc.drawLine(86 + iconOffsetX, 10, 90 + iconOffsetX, 14); - dc.drawLine(90 + iconOffsetX, 14, 82 + iconOffsetX, 22); - } - + dc.drawLine(startX, startY, startX + 7, startY + 7); + dc.drawLine(startX + 7, 19, startX + 3, startY + 11); + dc.drawLine(startX + 3, 23, startX + 3, startY - 2); + dc.drawLine(startX + 3, startY - 2, startX + 7, startY + 2); + dc.drawLine(startX + 7, startY + 2, startX -1, startY + 10); + } + + // Draw Do not disturb dc.setColor(upperForegroundColor, upperBackgroundColor); - - // Do not disturb if (System.getDeviceSettings().doNotDisturb) { - dc.drawCircle(161 - iconOffsetX, 17, 7); - dc.fillRectangle(158 - iconOffsetX, 16, 7, 3); + var noDisturbX = centerX + 28 + batteryIconOffsetX; + dc.drawCircle(noDisturbX, 17, 7); + dc.fillRectangle(noDisturbX - 3, 16, 7, 3); } - // Alarm + // Draw Alarm + var alarmCount = Sys.getDeviceSettings().alarmCount; if (alarmCount > 0) { - dc.fillPolygon([[178, 17], [180, 19], [181, 21], [182, 25], [183, 26], [183, 27], [172, 27], [172, 26], [173, 25], [174, 21], [175, 19]]); - dc.fillPolygon([[176, 28], [178, 30], [180, 28]]); + var alarmX = centerX + 42 + batteryIconOffsetX; + dc.fillPolygon([[alarmX + 6, 17], [alarmX + 9, 21], [alarmX + 10, 25], [alarmX + 11, 26], [alarmX + 11, 27], [alarmX, 27], [alarmX, 26], [alarmX + 1, 25], [alarmX + 2, 21], [alarmX + 3, 19]]); + dc.fillPolygon([[alarmX + 4, 28], [alarmX + 6, 30], [alarmX + 8, 28]]); } - // Sunrise/Sunset - if (showSunriseSunset) { - calcSunriseSunset(); - dc.fillPolygon([[45, 50], [57, 50], [50, 44]]); // upIcon - dc.fillPolygon([[184, 44], [194, 44], [188, 49]]); // downIcon - if (lcdFont) { - dc.drawText(59, 36, digitalUpright16, sunriseText, Gfx.TEXT_JUSTIFY_LEFT); - dc.drawText(181, 36, digitalUpright16, sunsetText, Gfx.TEXT_JUSTIFY_RIGHT); - } else { - var y = (deviceName.equals("vivoactive3") || deviceName.equals("vivoactive3m")) ? 32 : 28; - dc.drawText(57, y, Graphics.FONT_XTINY, sunriseText, Gfx.TEXT_JUSTIFY_LEFT); - dc.drawText(182, y, Graphics.FONT_XTINY, sunsetText, Gfx.TEXT_JUSTIFY_RIGHT); - } - } + var arcRadius = centerX - 3; // Step Bar background if (showStepBar) { @@ -372,7 +438,7 @@ class Digital5View extends Ui.WatchFace { dc.setColor(darkUpperBackground ? Gfx.COLOR_DK_GRAY : Gfx.COLOR_LT_GRAY, upperBackgroundColor); for(var i = 0; i < 10 ; i++) { var startAngleLeft = 130 + (i * 6); - dc.drawArc(centerX, centerY, 117, 0, startAngleLeft, startAngleLeft + 5); + dc.drawArc(centerX, centerY, arcRadius, 0, startAngleLeft, startAngleLeft + 5); } // Step Goal Bar @@ -387,7 +453,7 @@ class Digital5View extends Ui.WatchFace { } for(var i = 0; i < endIndex ; i++) { var startAngleLeft = 184 - (i * 6); - dc.drawArc(centerX, centerY, 117, 0, startAngleLeft, startAngleLeft + 5); + dc.drawArc(centerX, centerY, arcRadius, 0, startAngleLeft, startAngleLeft + 5); } } @@ -404,7 +470,7 @@ class Digital5View extends Ui.WatchFace { } for(var i = 0; i < 10 ; i++) { var startAngleRight = -10 + (i * 6); - dc.drawArc(centerX, centerY, 117, 0, startAngleRight, startAngleRight + 5); + dc.drawArc(centerX, centerY, arcRadius, 0, startAngleRight, startAngleRight + 5); } // KCal Goal Bar @@ -424,221 +490,196 @@ class Digital5View extends Ui.WatchFace { stopAngleRight = stopAngleRight > 59.0 ? 59.0 : stopAngleRight; for(var i = 0; i < 10 ; i++) { var startAngleRight = -10 + (i * 6); - if (startAngleRight < stopAngleRight) { dc.drawArc(centerX, centerY, 117, 0, startAngleRight, startAngleRight + 5); } + if (startAngleRight < stopAngleRight) { dc.drawArc(centerX, centerY, arcRadius, 0, startAngleRight, startAngleRight + 5); } } } - // Move Bar + // draw Move Bar if (showMoveBar) { var moveBarLevel = actinfo.moveBarLevel; + + var moveBarLength = .75 * width; + var moveBarLeft = (width - moveBarLength) / 2; + var moveBarLeftPart = moveBarLength * 0.388888889; + var moveBarRightStart = moveBarLeftPart + moveBarLeft + 2; + var moveBarRightPart = moveBarLength * 0.138888889; + var moveBarX = dataFieldsTop - 6; + + Log("Digital5View.onUpdate","(draw move bar) moveBarLength: " + moveBarLength + "moveBarLeft: " + moveBarLeft + "moveBarLeftPart: " + moveBarLeftPart + "moveBarRightStart: " + moveBarRightStart + "moveBarRightPart: " + moveBarRightPart + "moveBarX: " + moveBarX); + dc.setColor(darkUpperBackground ? Gfx.COLOR_DK_GRAY : Gfx.COLOR_LT_GRAY, upperBackgroundColor); - dc.fillRectangle(29, 144, 73, 4); - for (var i = 0 ; i < 4 ; i++) { dc.fillRectangle(104 + (i * 27), 144, 25, 4); } - if (moveBarLevel > Act.MOVE_BAR_LEVEL_MIN) { dc.setColor(Gfx.COLOR_RED, upperBackgroundColor); } - dc.fillRectangle(29, 144, 73, 4); - for (var i = 0 ; i < (moveBarLevel - 1) ; i++) { dc.fillRectangle(104 + (i * 27), 144, 25, 4); } - } - - - // ******************** TIME ****************************************** - if (lcdBackgroundVisible && lcdFont) { + dc.fillRectangle(moveBarLeft, moveBarX, moveBarLeftPart, 4); + for (var i = 0 ; i < 4 ; i++) { + dc.fillRectangle(moveBarRightStart + (i * (moveBarRightPart + 2)), moveBarX, moveBarRightPart, 4); + } + + if (moveBarLevel > Act.MOVE_BAR_LEVEL_MIN) { + dc.setColor(Gfx.COLOR_RED, upperBackgroundColor); + } + + dc.fillRectangle(moveBarLeft, moveBarX, moveBarLeftPart, 4); + + for (var i = 0 ; i < (moveBarLevel - 1) ; i++) { + dc.fillRectangle(moveBarRightStart + (i * (moveBarRightPart + 2)), moveBarX, moveBarRightPart, 4); + } + } + + // Date and home timezone + dc.setColor(upperForegroundColor, upperBackgroundColor); + var dateTimefontSize = Graphics.getFontHeight(dateTimeFont); + var dateYPosition = dataFieldsTop - 9 - dateTimefontSize; + var dateXPosition = centerX - 99; + var dateTimeText = calcHomeDateTime(); + + // draw Time + var timeFontSize = Graphics.getFontHeight(timeFont); + var timeYPosition = dateYPosition - timeFontSize + 10; + var yCorrection = 0; + if (lcdFont) { yCorrection = - 4; } + secondsFont = amPmFont; + secondsYPosition = dateYPosition - Graphics.getFontHeight(secondsFont) + yCorrection; + + if (lcdFont && lcdBackgroundVisible) { dc.setColor(darkUpperBackground ? Gfx.COLOR_DK_GRAY : Gfx.COLOR_LT_GRAY, upperBackgroundColor); if (showLeadingZero) { - dc.drawText(centerX, 51, digitalUpright72, "88:88", Gfx.TEXT_JUSTIFY_CENTER); + dc.drawText(centerX, timeYPosition, timeFont, "88:88", Gfx.TEXT_JUSTIFY_CENTER); } else { if (is24Hour) { - dc.drawText(centerX, 51, digitalUpright72, clockTime.hour < 10 ? "8:88" : "88:88", Gfx.TEXT_JUSTIFY_CENTER); + dc.drawText(centerX, timeYPosition, timeFont, clockTime.hour < 10 ? "8:88" : "88:88", Gfx.TEXT_JUSTIFY_CENTER); } else { - dc.drawText(centerX, 51, digitalUpright72, (clockTime.hour < 10 || clockTime.hour > 12) ? "8:88" : "88:88", Gfx.TEXT_JUSTIFY_CENTER); + dc.drawText(centerX, timeYPosition, timeFont, (clockTime.hour < 10 || clockTime.hour > 12) ? "8:88" : "88:88", Gfx.TEXT_JUSTIFY_CENTER); } } } - if (is24Hour) { - drawTime(hourColor, minuteColor, lcdFont ? digitalUpright72 : Graphics.FONT_NUMBER_HOT, dc); - } else { - var amPm = clockTime.hour < 12 ? "am" : "pm"; - if (lcdFont) { - drawTime(hourColor, minuteColor, digitalUpright72, dc); - dc.drawText(195, 93, digitalUpright20, amPm, Gfx.TEXT_JUSTIFY_LEFT); - } else { - drawTime(hourColor, minuteColor, Graphics.FONT_NUMBER_HOT, dc); - dc.drawText(191, 87, Graphics.FONT_XTINY, amPm, Gfx.TEXT_JUSTIFY_LEFT); - } - } + drawTime(hourColor, minuteColor, timeFont, dc, timeYPosition); + + // draw Date + if (onTravel) { + dc.drawText(dateXPosition, dateYPosition, dateTimeFont, dateTimeText[0], Gfx.TEXT_JUSTIFY_LEFT); + dc.drawText(width - dateXPosition, dateYPosition, dateTimeFont, dateTimeText[1], Gfx.TEXT_JUSTIFY_RIGHT); + } + else { + dc.drawText(centerX, dateYPosition, dateTimeFont, dateTimeText[0], Gfx.TEXT_JUSTIFY_CENTER); + } - // ******************** DATE ****************************************** - // KW + // draw Calendar Week if (showCalendarWeek) { var calendarWeekText = Ui.loadResource(Rez.Strings.CalendarWeek); - dc.drawText((lcdFont ? 43 : 50), (lcdFont ? 71 : 66), lcdFont ? digitalUpright20 : Graphics.FONT_XTINY, (calendarWeekText), Gfx.TEXT_JUSTIFY_RIGHT); - dc.drawText((lcdFont ? 43 : 50), (lcdFont ? 93 : 87), lcdFont ? digitalUpright20 : Graphics.FONT_XTINY, (getWeekOfYear(nowinfo)), Gfx.TEXT_JUSTIFY_RIGHT); + dc.drawText(centerX - 75, secondsYPosition - Graphics.getFontHeight(amPmFont), amPmFont, (calendarWeekText), Gfx.TEXT_JUSTIFY_RIGHT); + dc.drawText(centerX - 75, secondsYPosition, amPmFont, (getWeekOfYear(nowinfo)), Gfx.TEXT_JUSTIFY_RIGHT); } - // Date and home timezone - dc.setColor(upperForegroundColor, upperBackgroundColor); - var dateYPosition = showMoveBar ? 116 : 119; - dateYPosition = lcdFont ? dateYPosition : dateYPosition - 2; - if (onTravel && showHomeTimezone) { - var homeDayOfWeek = dayOfWeek - 1; - var homeDay = nowinfo.day; - var homeMonth = nowinfo.month; - var currentSeconds = clockTime.hour * 3600 + clockTime.min * 60 + clockTime.sec; - var utcSeconds = currentSeconds - clockTime.timeZoneOffset;// - (dst ? 3600 : 0); - var homeSeconds = utcSeconds + homeTimezoneOffset; - if (dst) { homeSeconds = homeTimezoneOffset > 0 ? homeSeconds : homeSeconds - 3600; } - var homeHour = ((homeSeconds / 3600)).toNumber() % 24l; - var homeMinute = ((homeSeconds - (homeHour.abs() * 3600)) / 60) % 60; - if (homeHour < 0) { - homeHour += 24; - homeDay--; - if (homeDay == 0) { - homeMonth--; - if (homeMonth == 0) { homeMonth = 12; } - homeDay = daysOfMonth(homeMonth); - } - homeDayOfWeek--; - if (homeDayOfWeek < 0) { homeDayOfWeek = 6; } - } - if (homeMinute < 0) { homeMinute += 60; } - var ampm = is24Hour ? "" : homeHour < 12 ? "A" : "P"; - homeHour = is24Hour ? homeHour : (homeHour == 12) ? homeHour : (homeHour % 12); - var weekdayText = weekdays[homeDayOfWeek]; - var dateText = dayMonth ? nowinfo.day.format(showLeadingZero ? "%02d" : "%01d") + " " + months[homeMonth - 1] : months[homeMonth - 1] + " " + nowinfo.day.format(showLeadingZero ? "%02d" : "%01d"); - var dateNumberText = Lang.format(dateFormat, [homeDay.format(showLeadingZero ? "%02d" : "%01d"), homeMonth.format(showLeadingZero ? "%02d" : "%01d")]); - var timeText = Lang.format("$1$:$2$", [homeHour.format(showLeadingZero ? "%02d" : "%01d"), homeMinute.format("%02d")]) + ampm; - dc.drawText(28, dateYPosition, lcdFont ? digitalUpright26 : Graphics.FONT_XTINY, weekdayText + (monthAsText ? dateText : dateNumberText), Gfx.TEXT_JUSTIFY_LEFT); - dc.drawText(216, dateYPosition, lcdFont ? digitalUpright26 : Graphics.FONT_XTINY, timeText, Gfx.TEXT_JUSTIFY_RIGHT); - } else { - var weekdayText = weekdays[dayOfWeek - 1]; - var dateText = dayMonth ? nowinfo.day.format(showLeadingZero ? "%02d" : "%01d") + " " + months[nowinfo.month - 1] : months[nowinfo.month - 1] + " " + nowinfo.day.format(showLeadingZero ? "%02d" : "%01d"); - var dateNumberText = Lang.format(dateFormat, [nowinfo.day.format(showLeadingZero ? "%02d" : "%01d"), nowinfo.month.format(showLeadingZero ? "%02d" : "%01d")]); - dc.drawText(centerX, dateYPosition, lcdFont ? digitalUpright26 : Graphics.FONT_XTINY, weekdayText + (monthAsText ? dateText : dateNumberText), Gfx.TEXT_JUSTIFY_CENTER); + // draw Sunrise/Sunset + if (showSunriseSunset) { + var notificationsBottomY = 30; + var sunRiseY = (timeYPosition - notificationsBottomY) / 2 + notificationsBottomY; + calcSunriseSunset(); + drawArrow(dc, .4 * centerX, sunRiseY, 0); + drawArrow(dc, 1.5 * centerX, sunRiseY, 1); + dc.drawText(.4 * centerX + 15, sunRiseY - 5, lcdFont ? digitalUpright20 : robotoCondensed24, sunriseText, Gfx.TEXT_JUSTIFY_LEFT); + dc.drawText(1.5 * centerX - 5, sunRiseY - 5, lcdFont ? digitalUpright20 : robotoCondensed24, sunsetText, Gfx.TEXT_JUSTIFY_RIGHT); } // ******************** DATA FIELDS *********************************** + var xyPositions = getXYPositions(UPPER_LEFT); // UpperLeft switch(upperLeftField) { - case 0: drawSteps(getXYPositions(UPPER_LEFT), dc, false); break; - case 1: drawCalories(getXYPositions(UPPER_LEFT), dc, KCAL, UPPER_LEFT); break; - case 2: drawCalories(getXYPositions(UPPER_LEFT), dc, ACTIVE_KCAL, UPPER_LEFT); break; - case 3: drawHeartRate(getXYPositions(UPPER_LEFT), dc, UPPER_LEFT); break; - case 4: drawDistance(getXYPositions(UPPER_LEFT), dc); break; - case 5: drawWithUnit(getXYPositions(UPPER_LEFT), dc, 5, UPPER_LEFT); break; - case 6: drawWithUnit(getXYPositions(UPPER_LEFT), dc, 6, UPPER_LEFT); break; - case 7: drawActiveTime(getXYPositions(UPPER_LEFT), dc, true, UPPER_LEFT); break; - case 8: drawActiveTime(getXYPositions(UPPER_LEFT), dc, false, UPPER_LEFT); break; - case 9: drawFloors(getXYPositions(UPPER_LEFT), dc, UPPER_LEFT); break; - case 10: drawMeters(getXYPositions(UPPER_LEFT), dc, UPPER_LEFT); break; - case 11: drawActKcalAvg(getXYPositions(UPPER_LEFT), dc, UPPER_LEFT); break; - case 12: drawSteps(getXYPositions(UPPER_LEFT), dc, true); break; - case 13: drawWithUnit(getXYPositions(UPPER_LEFT), dc, 13, UPPER_LEFT); break; - case 14: drawCalories(getXYPositions(UPPER_LEFT), dc, ACTIVE_KCAL_REACHED, UPPER_LEFT); break; + case 0: drawSteps(xyPositions, dc, false, UPPER_LEFT); break; + case 1: drawCalories(xyPositions, dc, KCAL, UPPER_LEFT); break; + case 2: drawCalories(xyPositions, dc, ACTIVE_KCAL, UPPER_LEFT); break; + case 3: drawHeartRate(xyPositions, dc, UPPER_LEFT); break; + case 4: drawWithUnit(xyPositions, dc, 4, UPPER_LEFT); break; + case 5: drawWithUnit(xyPositions, dc, 5, UPPER_LEFT); break; + case 6: drawWithUnit(xyPositions, dc, 6, UPPER_LEFT); break; + case 7: drawActiveTime(xyPositions, dc, true, UPPER_LEFT); break; + case 8: drawActiveTime(xyPositions, dc, false, UPPER_LEFT); break; + case 9: drawFloors(xyPositions, dc, UPPER_LEFT); break; + case 10: drawMeters(xyPositions, dc, UPPER_LEFT); break; + case 11: drawActKcalAvg(xyPositions, dc, UPPER_LEFT); break; + case 12: drawSteps(xyPositions, dc, true); break; + case 13: drawWithUnit(xyPositions, dc, 13, UPPER_LEFT); break; + case 14: drawCalories(xyPositions, dc, ACTIVE_KCAL_REACHED, UPPER_LEFT); break; } + xyPositions = getXYPositions(UPPER_RIGHT); // UpperRight switch(upperRightField) { - case 0: drawSteps(getXYPositions(UPPER_RIGHT), dc, false); break; - case 1: drawCalories(getXYPositions(UPPER_RIGHT), dc, KCAL, UPPER_RIGHT); break; - case 2: drawCalories(getXYPositions(UPPER_RIGHT), dc, ACTIVE_KCAL, UPPER_RIGHT); break; - case 3: drawHeartRate(getXYPositions(UPPER_RIGHT), dc, UPPER_RIGHT); break; - case 4: drawDistance(getXYPositions(UPPER_RIGHT), dc); break; - case 5: drawWithUnit(getXYPositions(UPPER_RIGHT), dc, 5, UPPER_RIGHT); break; - case 6: drawWithUnit(getXYPositions(UPPER_RIGHT), dc, 6, UPPER_RIGHT); break; - case 7: drawActiveTime(getXYPositions(UPPER_RIGHT), dc, true, UPPER_RIGHT); break; - case 8: drawActiveTime(getXYPositions(UPPER_RIGHT), dc, false, UPPER_RIGHT); break; - case 9: drawFloors(getXYPositions(UPPER_RIGHT), dc, UPPER_RIGHT); break; - case 10: drawMeters(getXYPositions(UPPER_RIGHT), dc, UPPER_RIGHT); break; - case 11: drawActKcalAvg(getXYPositions(UPPER_RIGHT), dc, UPPER_RIGHT); break; - case 12: drawSteps(getXYPositions(UPPER_RIGHT), dc, true); break; - case 13: drawWithUnit(getXYPositions(UPPER_RIGHT), dc, 13, UPPER_RIGHT); break; - case 14: drawCalories(getXYPositions(UPPER_RIGHT), dc, ACTIVE_KCAL_REACHED, UPPER_RIGHT); break; + case 0: drawSteps(xyPositions, dc, false, UPPER_LEFT); break; + case 1: drawCalories(xyPositions, dc, KCAL, UPPER_RIGHT); break; + case 2: drawCalories(xyPositions, dc, ACTIVE_KCAL, UPPER_RIGHT); break; + case 3: drawHeartRate(xyPositions, dc, UPPER_RIGHT); break; + case 4: drawWithUnit(xyPositions, dc, 4, UPPER_RIGHT); break; + case 5: drawWithUnit(xyPositions, dc, 5, UPPER_RIGHT); break; + case 6: drawWithUnit(xyPositions, dc, 6, UPPER_RIGHT); break; + case 7: drawActiveTime(xyPositions, dc, true, UPPER_RIGHT); break; + case 8: drawActiveTime(xyPositions, dc, false, UPPER_RIGHT); break; + case 9: drawFloors(xyPositions, dc, UPPER_RIGHT); break; + case 10: drawMeters(xyPositions, dc, UPPER_RIGHT); break; + case 11: drawActKcalAvg(xyPositions, dc, UPPER_RIGHT); break; + case 12: drawSteps(xyPositions, dc, true); break; + case 13: drawWithUnit(xyPositions, dc, 13, UPPER_RIGHT); break; + case 14: drawCalories(xyPositions, dc, ACTIVE_KCAL_REACHED, UPPER_RIGHT); break; } + xyPositions = getXYPositions(LOWER_LEFT); // LowerLeft switch(lowerLeftField) { - case 0: drawSteps(getXYPositions(LOWER_LEFT), dc, false); break; - case 1: drawCalories(getXYPositions(LOWER_LEFT), dc, KCAL, LOWER_LEFT); break; - case 2: drawCalories(getXYPositions(LOWER_LEFT), dc, ACTIVE_KCAL, LOWER_LEFT); break; - case 3: drawHeartRate(getXYPositions(LOWER_LEFT), dc, LOWER_LEFT); break; - case 4: drawDistance(getXYPositions(LOWER_LEFT), dc); break; - case 7: drawActiveTime(getXYPositions(LOWER_LEFT), dc, true, LOWER_LEFT); break; - case 8: drawActiveTime(getXYPositions(LOWER_LEFT), dc, false, LOWER_LEFT); break; - case 9: drawFloors(getXYPositions(LOWER_LEFT), dc, LOWER_LEFT); break; - case 14: drawCalories(getXYPositions(LOWER_LEFT), dc, ACTIVE_KCAL_REACHED, LOWER_LEFT); break; + case 0: drawSteps(xyPositions, dc, false, UPPER_LEFT); break; + case 1: drawCalories(xyPositions, dc, KCAL, LOWER_LEFT); break; + case 2: drawCalories(xyPositions, dc, ACTIVE_KCAL, LOWER_LEFT); break; + case 3: drawHeartRate(xyPositions, dc, LOWER_LEFT); break; + case 4: drawWithUnit(xyPositions, dc, 4, LOWER_LEFT); break; + case 6: drawWithUnit(xyPositions, dc, 6, LOWER_LEFT); break; + case 7: drawActiveTime(xyPositions, dc, true, LOWER_LEFT); break; + case 8: drawActiveTime(xyPositions, dc, false, LOWER_LEFT); break; + case 9: drawFloors(xyPositions, dc, LOWER_LEFT); break; + case 14: drawCalories(xyPositions, dc, ACTIVE_KCAL_REACHED, LOWER_LEFT); break; } + xyPositions = getXYPositions(LOWER_RIGHT); // LowerRight switch(lowerRightField) { - case 0: drawSteps(getXYPositions(LOWER_RIGHT), dc, false); break; - case 1: drawCalories(getXYPositions(LOWER_RIGHT), dc, KCAL, LOWER_RIGHT); break; - case 2: drawCalories(getXYPositions(LOWER_RIGHT), dc, ACTIVE_KCAL, LOWER_RIGHT); break; - case 3: drawHeartRate(getXYPositions(LOWER_RIGHT), dc, LOWER_RIGHT); break; - case 4: drawDistance(getXYPositions(LOWER_RIGHT), dc); break; - case 7: drawActiveTime(getXYPositions(LOWER_RIGHT), dc, true, LOWER_RIGHT); break; - case 8: drawActiveTime(getXYPositions(LOWER_RIGHT), dc, false, LOWER_RIGHT); break; - case 9: drawFloors(getXYPositions(LOWER_RIGHT), dc, LOWER_RIGHT); break; - case 14: drawCalories(getXYPositions(LOWER_RIGHT), dc, ACTIVE_KCAL_REACHED, LOWER_RIGHT); break; + case 0: drawSteps(xyPositions, dc, false, UPPER_LEFT); break; + case 1: drawCalories(xyPositions, dc, KCAL, LOWER_RIGHT); break; + case 2: drawCalories(xyPositions, dc, ACTIVE_KCAL, LOWER_RIGHT); break; + case 3: drawHeartRate(xyPositions, dc, LOWER_RIGHT); break; + case 4: drawWithUnit(xyPositions, dc, 4, LOWER_RIGHT); break; + case 6: drawWithUnit(xyPositions, dc, 6, LOWER_RIGHT); break; + case 7: drawActiveTime(xyPositions, dc, true, LOWER_RIGHT); break; + case 8: drawActiveTime(xyPositions, dc, false, LOWER_RIGHT); break; + case 9: drawFloors(xyPositions, dc, LOWER_RIGHT); break; + case 14: drawCalories(xyPositions, dc, ACTIVE_KCAL_REACHED, LOWER_RIGHT); break; } // Bottom field dc.setColor(fieldForegroundColor, fieldBackgroundColor); + xyPositions = getXYPositions(BOTTOM_FIELD); switch(bottomField) { - case 1: drawCalories(getXYPositions(BOTTOM_FIELD), dc, KCAL, BOTTOM_FIELD); break; - case 2: drawCalories(getXYPositions(BOTTOM_FIELD), dc, ACTIVE_KCAL, BOTTOM_FIELD); break; - case 3: drawHeartRate(getXYPositions(BOTTOM_FIELD), dc, BOTTOM_FIELD); break; - case 4: - drawWithUnit(getXYPositions(BOTTOM_FIELD), dc, 4, BOTTOM_FIELD); - if (distanceUnit == 0) { - drawCharacter(dc, K, 0); - drawCharacter(dc, M, 6); - } else { - drawCharacter(dc, M, 0); - drawCharacter(dc, I, 0); - } - break; - case 5: - drawWithUnit(getXYPositions(BOTTOM_FIELD), dc, 5, BOTTOM_FIELD); - if (altUnit == 0) { - drawCharacter(dc, M, 0); - } else { - drawCharacter(dc, F, 0); - drawCharacter(dc, T, 0); - } - break; - case 6: - drawWithUnit(getXYPositions(BOTTOM_FIELD), dc, 6, BOTTOM_FIELD); - drawCharacter(dc, M, 0); - drawCharacter(dc, B, 0); - break; - case 7: dc.drawText(120, 213, lcdFontDataFields ? digitalUpright20 : Graphics.FONT_XTINY, getActiveTimeText(true), Gfx.TEXT_JUSTIFY_CENTER); break; - case 8: dc.drawText(120, 213, lcdFontDataFields ? digitalUpright20 : Graphics.FONT_XTINY, getActiveTimeText(false), Gfx.TEXT_JUSTIFY_CENTER); break; - case 9: - drawFloors(getXYPositions(BOTTOM_FIELD), dc, BOTTOM_FIELD); - dc.fillPolygon([[63, 221], [75, 221], [68, 215]]); // up - dc.fillPolygon([[170, 216], [180, 216], [175, 221]]); // down - break; - case 10: - drawMeters(getXYPositions(BOTTOM_FIELD), dc, BOTTOM_FIELD); - dc.fillPolygon([[63, 221], [75, 221], [68, 215]]); // up - dc.fillPolygon([[170, 216], [180, 216], [175, 221]]); // down - break; + case 0: drawSteps(xyPositions, dc, false, BOTTOM_FIELD); break; + case 1: drawCalories(xyPositions, dc, KCAL, BOTTOM_FIELD); break; + case 2: drawCalories(xyPositions, dc, ACTIVE_KCAL, BOTTOM_FIELD); break; + case 3: drawHeartRate(xyPositions, dc, BOTTOM_FIELD); break; + case 4: drawWithUnit(xyPositions, dc, 4, BOTTOM_FIELD); break; + case 5: drawWithUnit(xyPositions, dc, 5, BOTTOM_FIELD); break; + case 6: drawWithUnit(xyPositions, dc, 6, BOTTOM_FIELD); break; + case 7: drawActiveTime(xyPositions, dc, true, BOTTOM_FIELD); break; + case 8: drawActiveTime(xyPositions, dc, false, BOTTOM_FIELD); break; + case 9: drawFloors(xyPositions, dc, BOTTOM_FIELD); break; + case 10: drawMeters(xyPositions, dc, BOTTOM_FIELD); break; case 11: - drawActKcalAvg(getXYPositions(BOTTOM_FIELD), dc, BOTTOM_FIELD); + drawActKcalAvg(xyPositions, dc, BOTTOM_FIELD); dc.setPenWidth(2); dc.drawCircle(69, 220, 4); dc.drawLine(65, 224, 74, 215); break; - case 13: - drawWithUnit(getXYPositions(BOTTOM_FIELD), dc, 13, BOTTOM_FIELD); - drawCharacter(dc, tempUnit == 0 ? C : F, 0); - break; - case 14: drawCalories(getXYPositions(BOTTOM_FIELD), dc, ACTIVE_KCAL_REACHED, BOTTOM_FIELD); break; + case 13: drawWithUnit(xyPositions, dc, 13, BOTTOM_FIELD); break; + case 14: drawCalories(xyPositions, dc, ACTIVE_KCAL_REACHED, BOTTOM_FIELD); break; } onPartialUpdate(dc); updateLocation(); @@ -647,30 +688,21 @@ class Digital5View extends Ui.WatchFace { // ******************** DRAWING FUNCTIONS ********************************* function drawSeconds(dc) { + var xBase = centerX + 70 + 3; var clockTime = Sys.getClockTime(); dc.setColor(upperBackgroundColor, upperBackgroundColor); if (is24Hour) { - if (lcdFont) { - dc.fillRectangle(195, 96, 25, 15); - dc.setClip(195, 96, 25, 15); - } else { - dc.fillRectangle(191, 93, 21, 17); - dc.setClip(191, 93, 21, 17); - } + dc.fillRectangle(xBase, secondsYPosition, 25, Graphics.getFontHeight(secondsFont)); + dc.setClip(xBase, secondsYPosition, 25, Graphics.getFontHeight(secondsFont)); dc.setColor(upperForegroundColor, upperBackgroundColor); - dc.drawText((lcdFont ? 195 : 191), (lcdFont ? 93 : 87), lcdFont ? digitalUpright20 : Graphics.FONT_XTINY, Lang.format("$1$", [clockTime.sec.format("%02d")]), Gfx.TEXT_JUSTIFY_LEFT); - } else { - if (lcdFont) { - dc.fillRectangle(195, 75, 25, 15); - dc.setClip(195, 75, 25, 15); - } else { - dc.fillRectangle(191, 74, 21, 17); - dc.setClip(191, 74, 21, 17); - } + dc.drawText(xBase, secondsYPosition, secondsFont, Lang.format("$1$", [clockTime.sec.format("%02d")]), Gfx.TEXT_JUSTIFY_LEFT); + } + else { + dc.fillRectangle(xBase, secondsYPosition, 25, Graphics.getFontHeight(secondsFont)); + dc.setClip(xBase, secondsYPosition, 25, Graphics.getFontHeight(secondsFont)); dc.setColor(upperForegroundColor, upperBackgroundColor); - dc.drawText((lcdFont ? 195 : 191), (lcdFont ? 71 : 68), lcdFont ? digitalUpright20 : Graphics.FONT_XTINY, Lang.format("$1$", [clockTime.sec.format("%02d")]), Gfx.TEXT_JUSTIFY_LEFT); + dc.drawText(xBase, secondsYPosition, secondsFont, Lang.format("$1$", [clockTime.sec.format("%02d")]), Gfx.TEXT_JUSTIFY_LEFT); } - //dc.clearClip(); // does not work here, instead clear clip at the beginning on onUpdate() } function daysOfMonth(month) { @@ -700,30 +732,32 @@ class Digital5View extends Ui.WatchFace { } } - function drawSteps(xyPositions, dc, showDeltaSteps) { + function drawSteps(xyPositions, dc, showDeltaSteps, field) { var bmpX = xyPositions[0]; var bmpY = xyPositions[1]; var textX = xyPositions[2]; var textY = xyPositions[3]; + var coloredStepText = App.getApp().getProperty("ColorizeStepText"); dc.drawBitmap(bmpX, bmpY, darkFieldBackground ? stepsIconWhite : stepsIcon); if (showDeltaSteps) { - dc.setColor(deltaSteps > 0 ? BRIGHT_RED : Gfx.COLOR_BLACK, fieldBackgroundColor); + dc.setColor(deltaSteps > 0 ? BRIGHT_RED : fieldForegroundColor, fieldBackgroundColor); } else { if (coloredStepText) { stepsReached = stepsReached > 1.0 ? 1.0 : stepsReached; var endIndex = (10.0 * stepsReached).toNumber(); - if (darkUpperBackground) { - dc.setColor(endIndex > 0 ? STEP_COLORS[endIndex - 1] : Gfx.COLOR_BLACK, fieldBackgroundColor); + if (darkFieldBackground) { + dc.setColor(endIndex > 0 ? STEP_COLORS[endIndex - 1] : fieldForegroundColor, fieldBackgroundColor); } else { - dc.setColor(endIndex > 0 ? DARK_STEP_COLORS[endIndex - 1] : Gfx.COLOR_BLACK, fieldBackgroundColor); + dc.setColor(endIndex > 0 ? DARK_STEP_COLORS[endIndex - 1] : fieldForegroundColor, fieldBackgroundColor); } } else { dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); } } - dc.drawText(textX, textY, lcdFontDataFields ? digitalUpright24 : Graphics.FONT_XTINY, (showDeltaSteps ? deltaSteps * -1 : steps), Gfx.TEXT_JUSTIFY_RIGHT); + dc.drawText(textX, textY, GetFieldFont(field, false), (showDeltaSteps ? deltaSteps * -1 : steps), Gfx.TEXT_JUSTIFY_RIGHT); } + function drawCalories(xyPositions, dc, kcalType, field) { var bmpX = xyPositions[0]; var bmpY = xyPositions[1]; @@ -757,12 +791,9 @@ class Digital5View extends Ui.WatchFace { fieldText = activeKcalReached.toString(); break; } - if (lcdFontDataFields) { - dc.drawText(field < 4 ? textX : textX + 13, textY, field < 4 ? digitalUpright24 : digitalUpright20, fieldText, Gfx.TEXT_JUSTIFY_RIGHT); - } else { - dc.drawText(field < 4 ? textX :textX + 4, textY, Graphics.FONT_XTINY, fieldText, Gfx.TEXT_JUSTIFY_RIGHT); - } + dc.drawText(field != BOTTOM_FIELD ? textX : textX + 13, textY, GetFieldFont(field, false), fieldText, Gfx.TEXT_JUSTIFY_RIGHT); } + function drawHeartRate(xyPositions, dc, field) { var bmpX = xyPositions[0]; var bmpY = xyPositions[1]; @@ -776,36 +807,16 @@ class Digital5View extends Ui.WatchFace { dc.fillPolygon([[bmpX + 2, bmpY + 9], [bmpX + 10, bmpY + 5], [bmpX + 18, bmpY + 9], [bmpX + 17, bmpY + 12], [bmpX + 10, bmpY + 18], [bmpX + 5, bmpY + 12]]); if (bpm >= maxBpm) { - dc.setColor(darkFieldBackground ? Gfx.COLOR_BLACK : Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT); + dc.setColor(fieldForegroundColor, Gfx.COLOR_TRANSPARENT); dc.fillRectangle(bmpX + 10, bmpY + 5, 2, 5); dc.fillRectangle(bmpX + 10, bmpY + 12, 2, 2); } - dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, field < 4 ? digitalUpright24 : digitalUpright20, (bpm > 0 ? bpm.toString() : ""), Gfx.TEXT_JUSTIFY_RIGHT); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, (bpm > 0 ? bpm.toString() : ""), Gfx.TEXT_JUSTIFY_RIGHT); - } - } - function drawDistance(xyPositions, dc) { - var bmpX = xyPositions[0]; - var bmpY = xyPositions[1]; - var textX = xyPositions[2]; - var textY = xyPositions[3]; - var unitLcdX = xyPositions[4]; - var unitLcdY = xyPositions[5]; - var unitX = xyPositions[6]; - var unitY = xyPositions[7]; - dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, digitalUpright24, distance > 99.99 ? distance.format("%.0f") : distance.format("%.1f"), Gfx.TEXT_JUSTIFY_RIGHT); - dc.drawText(unitLcdX, unitLcdY, digitalUpright16, distanceUnit == 0 ? "km" : "mi", Gfx.TEXT_JUSTIFY_LEFT); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, distance > 99.99 ? distance.format("%.0f") : distance.format("%.1f"), Gfx.TEXT_JUSTIFY_RIGHT); - dc.drawText(unitX, unitY, Graphics.FONT_XTINY, distanceUnit == 0 ? "km" : "mi", Gfx.TEXT_JUSTIFY_LEFT); - } + dc.setColor(fieldForegroundColor, fieldBackgroundColor); + dc.drawText(textX, textY, GetFieldFont(field, false), (bpm > 0 ? bpm.toString() : ""), Gfx.TEXT_JUSTIFY_RIGHT); + } + function drawWithUnit(xyPositions, dc, sensor, field) { var textX = xyPositions[2]; var textY = xyPositions[3]; @@ -815,6 +826,7 @@ class Digital5View extends Ui.WatchFace { var unitY = xyPositions[7]; var fieldText; var unitText = ""; + switch(sensor) { case 4: // Distance fieldText = distance > 99.99 ? distance.format("%.0f") : distance.format("%.1f"); @@ -827,13 +839,13 @@ class Digital5View extends Ui.WatchFace { if (null == altitude) { fieldText = "-"; } else { - if (altUnit == 0) { + if (distanceUnit == 0) { fieldText = (altitude.data.toFloat() + altitudeOffset).format("%.0f"); } else { fieldText = ((altitude.data.toFloat() + altitudeOffset) / 0.3048).format("%.0f"); } } - unitText = altUnit == 0 ? "m" : "ft"; + unitText = distanceUnit == 0 ? "m" : "ft"; break; case 6: // Pressure var pressureHistory = Sensor.getPressureHistory(null); @@ -842,15 +854,39 @@ class Digital5View extends Ui.WatchFace { fieldText = null == pressure ? "-" : ((pressure.data.toFloat() + pressureOffset) / 100.0).format("%.2f"); unitText = "mb"; break; - case 13: // Weather + case 13: // if (apiKey.length() > 0) { - if (field == 4) { textX += 10; } + + Log("Digital5View.drawWithUnit","(weather) - apiKey: " + apiKey); + + if (field == BOTTOM_FIELD) { textX += 10; } var icon = 7; + var dsResult = App.getApp().getProperty("dsResult"); + Log("Digital5View.drawWithUnit","(weather) - dsResult: " + dsResult + ", length: " + dsResult.length()); + + //if (dsResult.length() == 0){ + // Log("Digital5View.drawWithUnit","(weather) - no results yet, displaying empty"); + // fieldText = "----"; + // unitText = ""; + // break; + //} + + //if (!dsResult.equals("CURRENTLY") && !dsResult.equals("DAILY")){ + // Log("Digital5View.drawWithUnit","(weather) - displaying error"); + // fieldText = dsResult; + // unitText = ""; + // break; + //} + + if (currentWeather) { var temp = App.getApp().getProperty("temp"); - if (null == temp) { - fieldText = "--/--"; - unitText = "E"; + Log("Digital5View.drawWithUnit","(weather) - temp: " + temp); + if (!(temp instanceof Toybox.Lang.Float)) { + Log("Digital5View.drawWithUnit","(weather) - no current data available, displaying empty"); + fieldText = "----"; + unitText = ""; + break; } else { if (tempUnit == 1) { temp = temp * 1.8 + 32; } icon = App.getApp().getProperty("icon"); @@ -858,39 +894,136 @@ class Digital5View extends Ui.WatchFace { var bmpY = xyPositions[1]; fieldText = temp.format("%.1f"); } - } else { - var tempMin = App.getApp().getProperty("tempMin"); - var tempMax = App.getApp().getProperty("tempMax"); - if (null == tempMin || null == tempMax) { - fieldText = "--/--"; - unitText = "E"; + } + else { + var minTemp = App.getApp().getProperty("minTemp"); + var maxTemp = App.getApp().getProperty("maxTemp"); + Log("Digital5View.drawWithUnit","(weather) - minTemp: " + minTemp + ", maxTemp: " + maxTemp); + if (!(minTemp instanceof Toybox.Lang.Float)) { + Log("Digital5View.drawWithUnit","(weather) - no daily data available, displaying empty"); + fieldText = "----"; + unitText = ""; + break; } else { if (tempUnit == 1) { - tempMin = tempMin * 1.8 + 32; - tempMax = tempMax * 1.8 + 32; + minTemp = minTemp * 1.8 + 32; + maxTemp = maxTemp * 1.8 + 32; } icon = App.getApp().getProperty("icon"); var bmpX = xyPositions[0]; var bmpY = xyPositions[1]; - fieldText = tempMin.format("%.0f") + "/" + tempMax.format("%.0f"); + fieldText = minTemp.format("%.0f") + "/" + maxTemp.format("%.0f"); } } - drawWeatherSymbol(field, icon, dc); - } else { - fieldText = "--/--"; - unitText = "E"; + + Log("Digital5View.drawWithUnit","drawWithUnit (weather) - icon: " + icon ); + + drawWeatherSymbol(field, icon, dc, xyPositions); + } + else { + fieldText = "KEY"; + unitText = ""; + break; } + unitText = tempUnit == 0 ? "C" : "F"; break; } dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, field < 4 ? digitalUpright24 : digitalUpright20, fieldText, Gfx.TEXT_JUSTIFY_RIGHT); - dc.drawText(unitLcdX, unitLcdY, digitalUpright16, unitText, Gfx.TEXT_JUSTIFY_LEFT); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, fieldText, Gfx.TEXT_JUSTIFY_RIGHT); - dc.drawText(unitX, unitY, Graphics.FONT_XTINY, unitText, Gfx.TEXT_JUSTIFY_LEFT); + dc.drawText(textX, textY, GetFieldFont(field, false), fieldText, Gfx.TEXT_JUSTIFY_RIGHT); + drawUnitText(xyPositions, dc, unitText, field); + } + + function drawUnitText(xyPositions, dc, unitText, field){ + var bmpX = xyPositions[0] + 84 ; + var bmpY = xyPositions[1] - 4; + var unitLcdX = xyPositions[4]; + var unitLcdY = xyPositions[5]; + var unitX = xyPositions[6]; + var unitY = xyPositions[7]; + Log("Digital5View.drawUnitText", "unitText: " + unitText + ", field: " + field); + if (field == BOTTOM_FIELD){ + switch(unitText.toLower()){ + case "km": + //drawCharacter(xyPositions, dc, K, 0); + //drawCharacter(xyPositions, dc, M, 6); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "mi": + //drawCharacter(xyPositions, dc, M, 0); + //drawCharacter(xyPositions, dc, I, 0); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "m": + //drawCharacter(xyPositions, dc, M, -5); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "ft": + //drawCharacter(xyPositions, dc, F, 0); + //drawCharacter(xyPositions, dc, T, 0); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "mb": + //drawCharacter(xyPositions, dc, M, 0); + //drawCharacter(xyPositions, dc, B, 0); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "c": + //drawCharacter(xyPositions, dc, C, 6); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + case "f": + //drawCharacter(xyPositions, dc, F, 6); + dc.drawText(unitX, unitY, robotoCondensed7, unitText, Gfx.TEXT_JUSTIFY_LEFT); + break; + } + return; } + + dc.drawText(unitLcdX, unitLcdY, GetFieldFont(field, true), unitText, Gfx.TEXT_JUSTIFY_LEFT); } + + function drawCharacter(xyPositions,dc, char, x) { + dc.setPenWidth(1); + var bmpX = xyPositions[0] + 84 + x; + var bmpY = xyPositions[1]; + switch(char) { + case M: + dc.drawLine(bmpX - 1, bmpY + 2, bmpX - 1, bmpY + 7); + dc.drawLine(bmpX + 1, bmpY + 2, bmpX + 1, bmpY + 7); + dc.drawLine(bmpX + 3, bmpY + 2, bmpX + 3, bmpY + 7); + dc.drawLine(bmpX - 1, bmpY + 2, bmpX + 3, bmpY + 2); + break; + case I: + dc.drawLine(bmpX + 7, bmpY + 2, bmpX + 7, bmpY + 7); + break; + case K: + dc.drawLine(bmpX - 1, bmpY - 1, bmpX - 1, bmpY + 7); + dc.drawLine(bmpX - 1, bmpY + 4, bmpX + 3, bmpY); + dc.drawLine(bmpX - 1, bmpY + 3, bmpX + 3, bmpY + 7); + break; + case B: + dc.drawLine(bmpX + 5, bmpY - 1, bmpX + 5, bmpY + 7); + dc.drawLine(bmpX + 8, bmpY + 2, bmpX + 8, bmpY + 7); + dc.drawLine(bmpX + 5, bmpY + 2, bmpX + 8, bmpY + 2); + dc.drawLine(bmpX + 5, bmpY + 6, bmpX + 8, bmpY + 6); + break; + case C: + dc.drawLine(bmpX + 4, bmpY, bmpX, bmpY); + dc.drawLine(bmpX, bmpY, bmpX, bmpY + 8); + dc.drawLine(bmpX + 4, bmpY + 7, bmpX, bmpY + 7); + break; + case F: + dc.drawLine(bmpX + 4, bmpY, bmpX, bmpY); + dc.drawLine(bmpX, bmpY, bmpX, bmpY + 8); + dc.drawLine(bmpX + 3, bmpY + 3, bmpX - 1, bmpY + 3); + break; + case T: + dc.drawLine(bmpX + 8, bmpY, bmpX + 8, bmpY + 7); + dc.drawLine(bmpX + 6, bmpY, bmpX + 11, bmpY); + break; + } + } + function drawActiveTime(xyPositions, dc, isDay, field) { var textX = xyPositions[2]; var textY = xyPositions[3]; @@ -899,21 +1032,15 @@ class Digital5View extends Ui.WatchFace { var unitX = xyPositions[6]; var unitY = xyPositions[7]; var horAlign = Gfx.TEXT_JUSTIFY_RIGHT; + switch (field) { - case 0: break; - case 1: textX -= lcdFontDataFields ? 76 : 72; horAlign = Gfx.TEXT_JUSTIFY_LEFT; break; - case 2: break; - case 3: break; //textX -= lcdFontDataFields ? 55 : 51; horAlign = Gfx.TEXT_JUSTIFY_LEFT; break; + case UPPER_RIGHT: textX -= 76; horAlign = Gfx.TEXT_JUSTIFY_LEFT; break; } var activeTimeText = getActiveTimeText(isDay); dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, digitalUpright24, activeTimeText, horAlign); - dc.drawText(unitLcdX, unitLcdY, digitalUpright16, isDay ? "D" : "W", Gfx.TEXT_JUSTIFY_LEFT); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, activeTimeText, horAlign); - dc.drawText(unitX, unitY, Graphics.FONT_XTINY, isDay ? "D" : "W", Gfx.TEXT_JUSTIFY_LEFT); - } + dc.drawText(textX, textY, GetFieldFont(field, false), activeTimeText, horAlign); + drawUnitText(xyPositions, dc, isDay ? "D" : "W", field); + } function drawFloors(xyPositions, dc, field) { var bmpX = xyPositions[0]; @@ -922,17 +1049,22 @@ class Digital5View extends Ui.WatchFace { var textY = xyPositions[3]; var horAlign = Gfx.TEXT_JUSTIFY_RIGHT; switch (field) { - case 0: break; - case 1: bmpX +=2; textX += lcdFontDataFields ? 8 : 12; break; - case 2: break; - case 3: bmpX +=2; textX += lcdFontDataFields ? 8 : 12; break; - case 4: textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; break; + case UPPER_RIGHT: bmpX +=2; textX += 8; break; + case LOWER_RIGHT: bmpX +=2; textX += 8; break; + case BOTTOM_FIELD: textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; break; } var floorsClimbed = actinfo.floorsClimbed; var floorsDescended = actinfo.floorsDescended; dc.setColor(fieldForegroundColor, fieldBackgroundColor); // draw stairs icon - if (field < 4) { + if (field == BOTTOM_FIELD) + { + drawArrow(dc, bmpX, bmpY, 0); + drawArrow(dc, .66 * width, bmpY, 1); + horAlign = Gfx.TEXT_JUSTIFY_CENTER; + textX = centerX; + } + else { dc.setPenWidth(1); dc.drawLine(bmpX + 3, bmpY + 15, bmpX + 6, bmpY + 15); dc.drawLine(bmpX + 6, bmpY + 15, bmpX + 6, bmpY + 12); @@ -944,13 +1076,12 @@ class Digital5View extends Ui.WatchFace { dc.drawLine(bmpX + 15, bmpY + 6, bmpX + 15, bmpY + 3); dc.drawLine(bmpX + 15, bmpY + 3, bmpX + 18, bmpY + 3); } - if (lcdFontDataFields) { - dc.drawText(textX, textY, field < 4 ? digitalUpright24 : digitalUpright20, (floorsClimbed.toString() + "/" + floorsDescended.toString()), horAlign); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, (floorsClimbed.toString() + "/" + floorsDescended.toString()), horAlign); - } + dc.drawText(textX, textY, GetFieldFont(field, false), (floorsClimbed.toString() + "/" + floorsDescended.toString()), horAlign); } + function drawMeters(xyPositions, dc, field) { + var bmpX = xyPositions[0]; + var bmpY = xyPositions[1]; var textX = xyPositions[2]; var textY = xyPositions[3]; var unitLcdX = xyPositions[4]; @@ -960,59 +1091,65 @@ class Digital5View extends Ui.WatchFace { var metersClimbed = actinfo.metersClimbed.format("%0d"); var metersDescended = actinfo.metersDescended.format("%0d"); var horAlign = Gfx.TEXT_JUSTIFY_RIGHT; - if (field == 4) { textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; } + if (field == BOTTOM_FIELD) { textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; } switch (field) { - case 0: break; - case 1: unitLcdX += 8; unitX += 4; textX += lcdFontDataFields ? 8 : 4; break; //horAlign = Gfx.TEXT_JUSTIFY_LEFT; break; - case 2: break; - case 3: unitLcdX += 8; unitX += 4; textX += lcdFontDataFields ? 8 : 4; break; //horAlign = Gfx.TEXT_JUSTIFY_LEFT; break; - case 4: textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; break; + case UPPER_RIGHT: + unitLcdX += 8; + unitX += 4; + textX += 8; + break; + case LOWER_RIGHT: + unitLcdX += 8; + unitX += 4; + textX += 8; + break; + case BOTTOM_FIELD: + textX = width /2; + horAlign = Gfx.TEXT_JUSTIFY_CENTER; + break; } dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, field < 4 ? digitalUpright24 : digitalUpright20, metersClimbed.toString() + "/" + metersDescended.toString(), horAlign); - if (field < 4) { dc.drawText(unitLcdX, unitLcdY, digitalUpright16, "m", Gfx.TEXT_JUSTIFY_LEFT); } - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, metersClimbed.toString() + " / " + metersDescended.toString(), horAlign); - if (field < 4) { dc.drawText(unitX, unitY, Graphics.FONT_XTINY, "m", Gfx.TEXT_JUSTIFY_LEFT); } + dc.drawText(textX, textY, GetFieldFont(field, false), metersClimbed.toString() + "/" + metersDescended.toString(), horAlign); + drawUnitText(xyPositions, dc, "m", field); + + if (field == BOTTOM_FIELD){ + drawArrow(dc, bmpX, bmpY, 0); + drawArrow(dc, width - bmpX, bmpY, 1); + } + } + + function drawArrow(dc, x, y, direction){ + + var horSize = 12; + var vertSize = 6; + if (direction == 0){ + dc.fillPolygon([[x, y + vertSize ], [x + horSize, y + vertSize], [x + horSize / 2, y]]); //(left bottom , right bottom , top) + return; } + dc.fillPolygon([[x, y], [x + horSize, y], [x + horSize / 2, y + vertSize]]); //(left top , right top , bottom) + } + function drawActKcalAvg(xyPositions, dc, field) { var bmpX = xyPositions[0]; var bmpY = xyPositions[1]; var textX = xyPositions[2]; var textY = xyPositions[3]; var horAlign = Gfx.TEXT_JUSTIFY_RIGHT; - if (field == 4) { + if (field == BOTTOM_FIELD) { textX = 120; horAlign = Gfx.TEXT_JUSTIFY_CENTER; } else { dc.drawBitmap(bmpX, bmpY, darkFieldBackground ? burnedIconWhite : burnedIcon); } dc.setColor(fieldForegroundColor, fieldBackgroundColor); - if (lcdFontDataFields) { - dc.drawText(textX, textY, field < 4 ? digitalUpright24 : digitalUpright20, getActKcalAvg(activeKcal), horAlign); - } else { - dc.drawText(textX, textY, Graphics.FONT_XTINY, getActKcalAvg(activeKcal), horAlign); - } + dc.drawText(textX, textY, GetFieldFont(field, false), getActKcalAvg(activeKcal), horAlign); } - function drawWeatherSymbol(field, icon, dc) { - var x; - var y; - switch(field) { - case UPPER_LEFT: - x = 16; - y = 157; - break; - case UPPER_RIGHT: - x = 207; - y = 157; - break; - case BOTTOM_FIELD: - x = 85; - y = 216; - break; - } + + function drawWeatherSymbol(field, icon, dc, xyPositions) { + var x = xyPositions[0]; + var y = xyPositions[1]; + dc.setColor(fieldForegroundColor, fieldBackgroundColor); dc.setPenWidth(2); switch(icon) { @@ -1080,10 +1217,10 @@ class Digital5View extends Ui.WatchFace { dc.fillCircle(x + 13, y + 15, 2); dc.fillCircle(x + 7, y + 18, 2); break; - } dc.setPenWidth(1); } + function drawCloud(dc, x, y) { dc.setColor(fieldForegroundColor, fieldBackgroundColor); dc.fillCircle(x + 11, y + 6, 6); @@ -1096,57 +1233,28 @@ class Digital5View extends Ui.WatchFace { dc.fillRectangle(x + 5, y + 8, 12, 7); dc.setColor(fieldForegroundColor, fieldBackgroundColor); } - function drawCharacter(dc, char, x) { - dc.setPenWidth(1); - switch(char) { - case M: - dc.drawLine(168 + x, 218, 168 + x, 223); - dc.drawLine(170 + x, 218, 170 + x, 223); - dc.drawLine(172 + x, 218, 172 + x, 223); - dc.drawLine(168 + x, 218, 172 + x, 218); - break; - case I: - dc.drawLine(176, 218, 176, 223); - break; - case K: - dc.drawLine(168, 215, 168, 223); - dc.drawLine(168, 220, 172, 216); - dc.drawLine(168, 219, 172, 223); - break; - case B: - dc.drawLine(174, 215, 174, 223); - dc.drawLine(177, 218, 177, 223); - dc.drawLine(174, 218, 177, 218); - dc.drawLine(174, 222, 177, 222); - break; - case C: - dc.drawLine(173, 216, 169, 216); - dc.drawLine(169, 216, 169, 223); - dc.drawLine(173, 223, 168, 223); - break; - case F: - dc.drawLine(173, 216, 169, 216); - dc.drawLine(169, 216, 169, 223); - dc.drawLine(172, 219, 168, 219); - break; - case T: - dc.drawLine(177, 216, 177, 223); - dc.drawLine(175, 216, 180, 216); - break; - } - } - function drawTime(hourColor, minuteColor, font, dc) { + function drawTime(hourColor, minuteColor, font, dc, timeYPosition) { var hh = clockTime.hour; var hour = is24Hour ? hh : (hh == 12) ? hh : (hh % 12 == 0 ? 12 : hh % 12); - var y = (deviceName.equals("vivoactive3") || deviceName.equals("vivoactive3m")) ? 44 : 56; + dc.setColor(hourColor, Gfx.COLOR_TRANSPARENT); - dc.drawText(centerX - 6, lcdFont ? 51 : y, font, hour.format(showLeadingZero ? "%02d" : "%01d"), Gfx.TEXT_JUSTIFY_RIGHT); + dc.drawText(centerX - 6, timeYPosition, font, hour.format(showLeadingZero ? "%02d" : "%01d"), Gfx.TEXT_JUSTIFY_RIGHT); dc.setColor(upperForegroundColor, Gfx.COLOR_TRANSPARENT); - dc.drawText(centerX, lcdFont ? 51 : y, font, ":", Gfx.TEXT_JUSTIFY_CENTER); + dc.drawText(centerX, timeYPosition, font, ":", Gfx.TEXT_JUSTIFY_CENTER); dc.setColor(minuteColor, Gfx.COLOR_TRANSPARENT); - dc.drawText(centerX + 6, lcdFont ? 51 : y, font, clockTime.min.format("%02d"), Gfx.TEXT_JUSTIFY_LEFT); + dc.drawText(centerX + 6, timeYPosition, font, clockTime.min.format("%02d"), Gfx.TEXT_JUSTIFY_LEFT); dc.setColor(upperForegroundColor, Gfx.COLOR_TRANSPARENT); + + if (!is24Hour) { + var xBase = centerX + 70 + 3; + var yBase = secondsYPosition; + if (secondsAlwaysOn) { + yBase = yBase - Graphics.getFontHeight(amPmFont); + } + var amPm = clockTime.hour < 12 ? "am" : "pm"; + dc.drawText(xBase, yBase, amPmFont, amPm, Gfx.TEXT_JUSTIFY_LEFT); + } } function setBatteryColor(charge, dc) { @@ -1165,56 +1273,60 @@ class Digital5View extends Ui.WatchFace { function getXYPositions(field) { var bmpX, bmpY, textX, textY, unitLcdX, unitLcdY, unitX, unitY; - switch(field) { - case 0: // UPPER LEFT - bmpX = 16; - bmpY = 157; - textX = 115; - textY = lcdFontDataFields ? 153 : 152; + + var font = GetFieldFont(field, false); + var fontSize = Graphics.getFontHeight(font); + var textYPadding = (fieldHeight - fontSize)/2; + switch (field) { + case UPPER_LEFT: // UPPER LEFT + bmpX = 0.06667 * width; + bmpY = dataFieldsTop + dataFieldsTopPadding; + textX = centerX - 5; + textY = dataFieldsTop + textYPadding; unitLcdX = 16; - unitLcdY = 160; + unitLcdY = dataFieldsTop + 10; unitX = 16; - unitY = 152; + unitY = dataFieldsTop + 2; break; - case 1: // UPPER RIGHT - bmpX = 207; - bmpY = 157; - textX = lcdFontDataFields ? 202 : 196; - textY = lcdFontDataFields ? 153 : 152; - unitLcdX = 207; - unitLcdY = 160; - unitX = 200; - unitY = 152; + case UPPER_RIGHT: // UPPER RIGHT + bmpX = width - 33; + bmpY = dataFieldsTop + dataFieldsTopPadding; + textX = width - 38; + textY = dataFieldsTop + textYPadding; + unitLcdX = width - 33; + unitLcdY = dataFieldsTop + 10; + unitX = width - 40; + unitY = dataFieldsTop + 2; break; - case 2: // LOWER LEFT - bmpX = 36; - bmpY = 187; - textX = 115; - textY = lcdFontDataFields ? 184 : 183; + case LOWER_LEFT: // LOWER LEFT + bmpX = 0.15 * width; + bmpY = dataFieldsTop + fieldHeight + dataFieldsTopPadding; + textX = centerX - 5; + textY = dataFieldsTop + fieldHeight + textYPadding; unitLcdX = 36; - unitLcdY = 190; + unitLcdY = dataFieldsTop + fieldHeight + 10; unitX = 36; - unitY = 183; + unitY = dataFieldsTop + fieldHeight + 3; break; - case 3: // LOWER RIGHT - bmpX = 187; - bmpY = 187; - textX = lcdFontDataFields ? 181 : 175; - textY = lcdFontDataFields ? 184 : 183; - unitLcdX = 187; - unitLcdY = 190; - unitX = 180; - unitY = 183; + case LOWER_RIGHT: // LOWER RIGHT + bmpX = width - 53; + bmpY = dataFieldsTop + fieldHeight + dataFieldsTopPadding; + textX = width - 59; + textY = dataFieldsTop + fieldHeight + textYPadding; + unitLcdX = width - 53; + unitLcdY = dataFieldsTop + fieldHeight + 10; + unitX = width - 60; + unitY = dataFieldsTop + fieldHeight + 3; break; - case 4: // BOTTOM_FIELD - bmpX = 85; - bmpY = 216; - textX = 150; - textY = 213; - unitLcdX = 0; - unitLcdY = 0; - unitX = 0; - unitY = 0; + case BOTTOM_FIELD: // BOTTOM_FIELD + bmpX = 0.33 * width; + bmpY = dataFieldsTop + 2 * fieldHeight + dataFieldsTopPadding; + textX = centerX + 30; + textY = dataFieldsTop + 2 * fieldHeight + textYPadding + 1; + unitLcdX = width - 83; + unitLcdY = dataFieldsTop + 2 * fieldHeight + 10; + unitX = .7 * width; + unitY = dataFieldsTop + 2 * fieldHeight + 3; break; } return [ bmpX, bmpY, textX, textY, unitLcdX, unitLcdY, unitX, unitY ]; @@ -1317,11 +1429,90 @@ class Digital5View extends Ui.WatchFace { if (value > max) { return max; } return value; } + + function GetFieldFont(fieldNumber, isUnitText) { + if (fieldNumber == BOTTOM_FIELD) { + return lcdFontDataFields ? digitalUpright20 : robotoCondensed24; + } + + if (isUnitText){ + return lcdFontDataFields ? digitalUpright16 : robotoCondensed7; + } + return lcdFontDataFields ? digitalUpright24 : robotoCondensed24; + } + + /// + /// Get the home date and time, both time zone dependent. Depending on settings we may return the current date, and an empty time + /// + /// array that contains Date and Time + function calcHomeDateTime(){ + var dst = App.getApp().getProperty("DST"); + var dayOfWeek = nowinfo.day_of_week; + var dayMonth = App.getApp().getProperty("DateFormat") == 0; + var dateFormat = dayMonth ? "$1$.$2$" : "$2$/$1$"; + var monthAsText = App.getApp().getProperty("MonthAsText"); + var timezoneOffset = clockTime.timeZoneOffset; + var showHomeTimezone = App.getApp().getProperty("ShowHomeTimezone"); + var showHomeDate = App.getApp().getProperty("ShowHomeDate"); + var homeTimezoneOffset = dst ? App.getApp().getProperty("HomeTimezoneOffset") + 3600 : App.getApp().getProperty("HomeTimezoneOffset"); + var onTravel = timezoneOffset != homeTimezoneOffset; + + var monthText = ""; + var timeText = ""; + var currentWeekdayText = weekdays[dayOfWeek - 1]; + var currentDateText = dayMonth ? nowinfo.day.format(showLeadingZero ? "%02d" : "%01d") + " " + months[nowinfo.month - 1] : months[nowinfo.month - 1] + " " + nowinfo.day.format(showLeadingZero ? "%02d" : "%01d"); + var currentDateNumberText = Lang.format(dateFormat, [nowinfo.day.format(showLeadingZero ? "%02d" : "%01d"), nowinfo.month.format(showLeadingZero ? "%02d" : "%01d")]); + monthText = currentWeekdayText + (monthAsText ? currentDateText : currentDateNumberText); + + if (!onTravel) { + // if we are not traveling, just show the current date, time will be empty + return [monthText, timeText]; + } - function getDeviceName() { - if (deviceName == null) { - deviceName = Ui.loadResource(Rez.Strings.deviceName); + if (showHomeTimezone || showHomeDate){ + // we are traveling. If we are showing either home Time or home Date, we need to calculate this + var currentSeconds = clockTime.hour * 3600 + clockTime.min * 60 + clockTime.sec; + var utcSeconds = currentSeconds - clockTime.timeZoneOffset; + + var homeDayOfWeek = dayOfWeek - 1; + var homeDay = nowinfo.day; + var homeMonth = nowinfo.month; + var homeSeconds = utcSeconds + homeTimezoneOffset; + if (dst) { + homeSeconds = homeTimezoneOffset > 0 ? homeSeconds : homeSeconds - 3600; + } + var homeHour = ((homeSeconds / 3600)).toNumber() % 24l; + var homeMinute = ((homeSeconds - (homeHour.abs() * 3600)) / 60) % 60; + + if (homeHour < 0) { + homeHour += 24; + homeDay--; + if (homeDay == 0) { + homeMonth--; + if (homeMonth == 0) { homeMonth = 12; } + homeDay = daysOfMonth(homeMonth); + } + homeDayOfWeek--; + if (homeDayOfWeek < 0) { homeDayOfWeek = 6; } + } + if (homeMinute < 0) { homeMinute += 60; } + + var ampm = is24Hour ? "" : homeHour < 12 ? "A" : "P"; + homeHour = is24Hour ? homeHour : (homeHour == 12) ? homeHour : (homeHour % 12); + + if (showHomeDate) { + // if we want to show the home date, we need to calculate it + var homeWeekdayText = weekdays[homeDayOfWeek]; + var homeDateText = dayMonth ? + homeDay.format(showLeadingZero ? "%02d" : "%01d") + " " + months[homeMonth - 1] : + months[homeMonth - 1] + " " + homeDay.format(showLeadingZero ? "%02d" : "%01d"); + var homeDateNumberText = Lang.format(dateFormat, [homeDay.format(showLeadingZero ? "%02d" : "%01d"), homeMonth.format(showLeadingZero ? "%02d" : "%01d")]); + monthText = homeWeekdayText + (monthAsText ? homeDateText : homeDateNumberText); + } + + timeText = Lang.format("$1$:$2$", [homeHour.format(showLeadingZero ? "%02d" : "%01d"), homeMinute.format("%02d")]) + ampm; } - return deviceName; + + return [monthText, timeText]; } }