summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-07-16 16:45:13 +0000
committerKarl Berry <karl@freefriends.org>2008-07-16 16:45:13 +0000
commit17181358a96d8df7b64dfb65acd0dec0899a2766 (patch)
tree852563503a78679722d89359fd8aff1fcb0e853f /Master/texmf-dist/source
parent7ae66df0370923598d28e4d3e3544e9480f00b55 (diff)
hyph-utf8 update (14jul08)
git-svn-id: svn://tug.org/texlive/trunk@9604 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/generic/hyph-utf8/make-exhyph.pl50
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/make-exhyph.pl b/Master/texmf-dist/source/generic/hyph-utf8/make-exhyph.pl
new file mode 100644
index 00000000000..3fe44239d21
--- /dev/null
+++ b/Master/texmf-dist/source/generic/hyph-utf8/make-exhyph.pl
@@ -0,0 +1,50 @@
+#!/usr/bin/perl
+# -*- coding: utf-8; -*-
+# Copyright (C) 2008 Vladimir Volovich.
+# You may freely use, modify and/or distribute this file.
+#
+# Generate additional patterns (for some language), to be used in case
+# there is an alternative hyphen character available.
+#
+# It enables the hyphenation of words containing explicit hyphens
+# when using fonts with \hyphenchar\font <> `\- (e.g. T1 or T2A encoding).
+#
+# sample usage: perl make-exhyph.pl ru > exhyph-ru.tex
+
+use strict;
+use utf8;
+binmode(STDOUT, ":utf8");
+
+my %alphabet = (
+ 'ru' => [ qw( а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я ) ],
+ 'uk' => [ qw( а б в г ґ д е є ж з и і ї й к л м н о п р с т у ф х ц ч ш щ ь ю я ' ) ]
+);
+
+my $lang = $ARGV[0];
+die "unspecified lang" if ! defined $lang;
+die "invalid lang" if ! exists $alphabet{$lang};
+
+my @alphabet = @{$alphabet{$lang}};
+
+print <<\EOF;
+\begingroup
+\lccode45=45 % Make hyphen "-" a word constituent
+\patterns{
+8-7
+--8
+EOF
+
+for my $l (@alphabet) {
+ print ".${l}-8\n";
+}
+
+for my $l1 (@alphabet) {
+ for my $l2 (@alphabet) {
+ print "-${l1}8${l2}8\n8${l1}8${l2}-\n";
+ }
+}
+
+print <<\EOF;
+}
+\endgroup
+EOF