diff --git a/resources/README.md b/resources/README.md index 07969749..077cbb86 100644 --- a/resources/README.md +++ b/resources/README.md @@ -12,7 +12,9 @@ This folder contains resources that is used for building or packaging the projec - `icons/icon.{icns,ico,inl,rc,svg}`: lite-xl icon in various formats. - `linux/com.lite_xl.LiteXL.appdata.xml`: AppStream metadata. - `linux/com.lite_xl.LiteXL.desktop`: Desktop file for Linux desktops. -- `macos/dmg-cover.png`: Background image for packaging macOS DMGs. +- `macos/background.png`: Background image for packaging macOS DMGs. +- `macos/background@2x.png`: HiDPI image for packaging macOS DMGs. +- `macos/background.tiff`: TIFF image for packaging macOS DMGs. - `macos/Info.plist.in`: Template for generating `info.plist` on macOS. See `macos/macos-retina-display.md` for details. - `macos/lite-xl-dmg.py`: Configuration options for dmgbuild for packaging macOS DMGs. - `windows/001-lua-unicode.diff`: Patch for allowing Lua to load files with UTF-8 filenames on Windows. @@ -21,5 +23,23 @@ This folder contains resources that is used for building or packaging the projec - `include/lite_xl_plugin_api.h`: Native plugin API header. See the contents of `lite_xl_plugin_api.h` for more details. +### macOS DMG covers + +The DMG files uses `macos/background.tiff` as the background, which is created from +`macos/background.png` and `macos/background@2x.png` with the following command: + +```sh +tiffutil -cathidpicheck macos/background.png macos/background@2x.png -out macos/background.tiff +``` + +`macos/background@2x.png` should be double the size of `macos/background.png` with 144 PPI. +You can set the PPI by running: + +```sh +sips -s dpiWidth 144 -s dpiHeight 144 macos/background@2x.png +``` + +`sips` and `tiffutil` are available by default on macOS. + [1]: https://mesonbuild.com/Cross-compilation.html diff --git a/resources/macos/background.png b/resources/macos/background.png new file mode 100644 index 00000000..bcf86baf Binary files /dev/null and b/resources/macos/background.png differ diff --git a/resources/macos/background.tiff b/resources/macos/background.tiff new file mode 100644 index 00000000..b74d192e Binary files /dev/null and b/resources/macos/background.tiff differ diff --git a/resources/macos/background@2x.png b/resources/macos/background@2x.png new file mode 100644 index 00000000..1e18d1d0 Binary files /dev/null and b/resources/macos/background@2x.png differ diff --git a/resources/macos/dmg-cover.png b/resources/macos/dmg-cover.png deleted file mode 100644 index 1df7b60d..00000000 Binary files a/resources/macos/dmg-cover.png and /dev/null differ diff --git a/resources/macos/lite-xl-dmg.py b/resources/macos/lite-xl-dmg.py index 27b24417..59b52940 100644 --- a/resources/macos/lite-xl-dmg.py +++ b/resources/macos/lite-xl-dmg.py @@ -8,21 +8,23 @@ app_name = os.path.basename(app_path) # Image options format = defines.get("format", "UDZO") +# all sizes here are in points (pt)s +# for reference, size-in-points = size-in-pixels * 72 / dpi +# background DPI is 300, icon DPI is assumed to be 96 + # Content options files = [(app_path, app_name)] -symlinks = { "Applications": "/Applications" } +symlinks = {"Applications": "/Applications"} icon = "resources/icons/icon.icns" -icon_locations = { - app_name: (144, 248), - "Applications": (336, 248) -} +icon_locations = {app_name: (170, 140), "Applications": (384, 140)} # Window options -background = "resources/macos/dmg-cover.png" -window_rect = ((360, 360), (480, 380)) +background = "resources/macos/background.tiff" +window_rect = ((100, 338), (550, 362)) default_view = "coverflow" include_icon_view_settings = True +show_icon_preview = True # Icon view options -icon_size = 80 -text_size = 11.0 +icon_size = 128 +text_size = 13