Skip to content

Instantly share code, notes, and snippets.

@dhotson
Created October 16, 2018 14:25
Show Gist options
  • Save dhotson/21c687ab044ed13d0dc109b6cf633715 to your computer and use it in GitHub Desktop.
Save dhotson/21c687ab044ed13d0dc109b6cf633715 to your computer and use it in GitHub Desktop.
Homebrew formula for jart/hiptext (https://github.com/jart/hiptext)
require "formula"
class Hiptext < Formula
homepage "https://github.com/jart/hiptext"
head "https://github.com/jart/hiptext.git", :branch => "master"
depends_on "pkg-config" => :build
depends_on "ragel" => :build
# depends_on :libpng
depends_on "jpeg"
depends_on "ffmpeg"
depends_on "freetype"
depends_on "glog"
patch :DATA
#ENV["PKG_CONFIG_PATH"] = "#{HOMEBREW_PREFIX}/lib/pkgconfig:#{MacOS::X11.lib}/pkgconfig"
#pkg-config --libs libavcodec libavformat libavutil libswscale
def install
system "make"
system "install -m 0755 hiptext #{HOMEBREW_PREFIX}/bin"
end
end
__END__
diff --git a/font.cc b/font.cc
index e3b3218..b9cf579 100644
--- a/font.cc
+++ b/font.cc
@@ -11,7 +11,7 @@
#include "graphic.h"
#include "pixel.h"
-DEFINE_string(font, "DejaVuSansMono.ttf",
+DEFINE_string(font, "/System/Library/Fonts/Monaco.dfont",
"The path to the font .ttf file to use.");
DEFINE_int32(font_index, 0, "Index of face to use inside font .ttf file.");
DEFINE_int32(font_size, 11, "The size of the font in points.");
diff --git a/hiptext.cc b/hiptext.cc
index a23fa02..da0c96f 100644
--- a/hiptext.cc
+++ b/hiptext.cc
@@ -202,9 +202,9 @@ int main(int argc, char** argv) {
google::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
google::InstallFailureSignalHandler();
- const char* lang = std::getenv("LANG");
- if (lang == nullptr) lang = "en_US.utf8";
- std::locale::global(std::locale(lang));
+ //const char* lang = std::getenv("LANG");
+ //if (lang == nullptr) lang = "en_US.utf8";
+ //std::locale::global(std::locale(lang));
InitFont();
Movie::InitializeMain();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment