달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2008. 8. 29. 09:26

Programmer를 위한 글꼴 Computing에 관한 독백2008. 8. 29. 09:26

그동안 Programming을 하기 위해 편집기를 펴 놓고 source code를 보면서, 하라는 coding은 안하고 편집기의 글꼴(font)을 이것저것 바꾸는 짓을 꽤 많이도 했다.

나름대로 세운 programming을 위한 글꼴의 기준은 다음과 같다.


1. I(alphabet 대문자 i), 1(숫자 하나), l(alphabet 소문자 L) 구별이 쉬워야 한다.

2. O(alphabet 대문자 O),  o(alphabet문 소문자 o),  ㅇ(한글  자소 ㅇ)  구별이 쉬워야  한다.

3. 한글이건 alphabet이건 고정폭 글꼴이어야 한다. 왜냐하면 열(column)을 헤아려야 할 경우가 왕왕 있기 때문이다.

4. 한글과 alphabet이 이질감 없이 잘 어울려야 한다. 음.... 이건 좀 애매하구만.

5. 소괄호, 중괄호, 대괄호 구별이 잘 되어야 한다.

6. 마침표와 쉼표 구분이 잘 되어야 한다.

7. vertical bar(|)와 /(backslash) 구분이 잘 되어야 한다.

8. 글꼴 외곽이 또렷해야 한다.


8번 항에 대해 더 이야기하면 외곽이 또렷하려면 antialiasing 먹인 글꼴, 이를테면 이번 Windows Vista의 기본 글꼴인 맑은 고딕 같은 글꼴은 대략... 그런데 개인적으로 antialiasing 먹인 글꼴이 미려해 보이긴 해서, 이건 좀 왔다리갔다리 한다. 그런데 확실히 눈은 antialiasing 먹인 글꼴이 더 피곤한 것 같다.

programming에 어울리는 글꼴이란 것은 비단 하얀 말만의 고민은 아니었나 보다. Web 검색 결과 국내외를 막론하고 해당 주제에 대한 많은 글들을 볼 수 있었으며, 보아하니 BitStream Vera Sans Mono라 는 글꼴들을 많이 쓰는 듯 하여 하얀 말도 채택하였다. 그런데 영문 글꼴이다 보니 한글은 여전히 떨떠름해 아쉽다. code야는 100% alphabet이지만 주석엔 한글도 써야 할 것 아닌가. 한글도 멋지게 쓸 수 있는 방법 아시는 분은 좀 알려주시라.

아래는 BitStream Vera Sans Mono 글꼴 예시.


사용자 삽입 이미지


(뱀발)

실은 한글 글꼴 중에도 마음에 드는 것이 있기는 있다. 우리글닷컴이 라는 회사가 만든 바탕체인데, 특히 이중에서 '우리신문'이라는 글꼴이 상당히 마음에 든다. 우리글닷컴 site 가 보면 인쇄용이 아닌 화면용 한글 글꼴에 대한 성찰을 꽤 많이 한 냄새가 여기저기 난다. 실제로 하얀 말도 화면용 영문 글꼴은 참 예쁜데 왜 한글용 한글 글꼴은 하나도 마음에 드는 것이 없는지 참 궁금했었는데 그러한 우리글닷컴의 주장이 그러한 궁금증을 많이 해소시켜 준 듯 하다. 한 번 쓰고 싶은 글꼴이다.

그런데 우리글닷컴의 한글 글꼴은 가변폭 글꼴이다 보니, programmer를 위한 글꼴로 적합할지는 잘 모르겠다.

----------------------------

예전 blog에다 2007년 7월 6일에 쓴 글을 약간 고쳐서 다시 올림

:
Posted by 하얀 말
  • 또 nVision 08 이야기. CUDA로 encoding 속도를 향상시킨 Video Encoder 소개가 있었단다. “데끼리~!”긴 한데 CUDA는 nVidia GPU에서만 돈다. CUDA도 소비자를 nVidia에 Lock-in 시키기는 도구인 거지.(nVision nVision08 CUDA)2008-08-28 11:32:25
  • 요새 ATI에 발리지만 nVidia의 S/W 역량은 ATI보다 나은 거 같아. driver의 성능, 안정성이 한동안 우위였고 Cg, CUDA 같은 것도 만들고 말야. 그 S/W 역량의 우위가 그간의 ATI에 대한 경쟁 우위의 이유 중 하나일 거야.(S/W역량 nVidia Cg CUDA 경쟁력)2008-08-28 11:36:13

이 글은 하얀말님의 2008년 8월 28일의 미투데이 내용입니다.

:
Posted by 하얀 말

이 글은 하얀말님의 2008년 8월 27일의 미투데이 내용입니다.

:
Posted by 하얀 말
2008. 8. 27. 04:31

하얀말의 미투데이 - 2008년 8월 26일 篇隣2008. 8. 27. 04:31

  • 금메달 한국 야구, 청와대 행사에 귀국부터 위기라~. 일간스포츠가 이런 기사를? 일간스포츠 중앙일보 거잖아? 정략적으로 이용해 먹으려는 2MB 위시한 정치꾼 땜에 메달리스트들 귀찮겠다…(올림픽 메달리스트 정략적이용 2MB)2008-08-26 10:36:32
  • 은하도시? 역시 정치에 기웃거려 한 몫 차지하려는 쑈였어…. 실제 일본 쓰쿠바 같은 과학 도시 생기는 건 텄구만! 한 자리 차지했으니 목적 달성했는데 추진할 필요 없겠지?(은하도시 쓰쿠바 정략적이용)2008-08-26 11:07:13
  • 방만한 공공 기관 구조 조정은 현재까지는 거의 유일무이하게 지지하는 2MB의 정책이다. 다만 공공 개혁이 재벌에게 독과점 공기업 넘기는 작업이 아니길 바란다. 공공 개혁의 대의 명분인 효율성은 경쟁의 결과이지 민영화한다고 저절로 되는 것은 아니다.(공공개혁 2MB 경쟁 민영화 독과점 재벌)2008-08-26 18:00:57
  • ''747 공약의 7은 이미 달성''? 그게 올림픽 7위의 7이었어? 지랄도 퍽한다… 피식!(747공약 지랄 헛소리)2008-08-26 18:04:25

이 글은 하얀말님의 2008년 8월 26일의 미투데이 내용입니다.

:
Posted by 하얀 말
/*
 * $HeadURL$
 * $Revision$
 * $Date$
 * ====================================================================
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */

import java.io.File;
import java.io.InputStream;
import java.io.StringWriter;

import javax.xml.parsers.DocumentBuilderFactory;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.FileRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.w3c.dom.Document;

import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;

/**
 *
 * This is a sample application that demonstrates how to use the Jakarta
 * HttpClient API.
 *
 * This application sends an XML document to a remote web server using HTTP POST
 *
 * @author Sean C. Sullivan
 * @author Ortwin Glueck
 * @author Oleg Kalnichevski
 * @author Paul King
 */
public class PostSOAP {

  /**
   *
   * Usage: java PostSOAP http://mywebserver:80/ SOAPAction c:\foo.xml
   *
   * @param args
   *            command line arguments Argument 0 is a URL to a web server
   *            Argument 1 is the SOAP Action Argument 2 is a local filename
   *
   */
  public static void main(String[] args) throws Exception {
    boolean isBeautify = false;

    if (args.length != 3 && args.length != 2) {
      System.out.print("Usage: java -classpath <classpath> [-Dorg.apache.");
      System.out.print("commons.logging.simplelog.defaultlog=<loglevel>] Post");
      System.out.print("SOAP <url> <filename> [<soapaction>] [-beautify]\n");
      System.out.print("<classpath> - must contain the commons-httpclient.jar");
      System.out.print(" and commons-logging.jar\n");
      System.out.print("<loglevel> - one of error, warn, info, debug, trace\n");
      System.out.print("<url> - the URL to post the file to\n");
      System.out.print("<filename> - file to post to the URL\n");
      System.out.print("<soapaction> - the SOAP action header value");
      System.out.print("(optional)\n");
      System.out.println("-beautify - show pretty result(optional)\n\n");
      System.exit(1);
    }
    // Get target URL
    String strURL = args[0];
    String strSoapAction = "";

    if (4 == args.length) {
      // Get SOAP action
      strSoapAction = args[2];

      if ("-beautify".equals(args[3])) {
        isBeautify = true;
      }
    }

    if (3 == args.length) {
      if ("-beautify".equals(args[2])) {
        isBeautify = true;
      } else {
        strSoapAction = args[2];
      }
    }


    // Get file to be posted
    String strXMLFilename = args[1];
    File input = new File(strXMLFilename);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    RequestEntity entity = new FileRequestEntity(input,
        "text/xml; charset=ISO-8859-1");
    post.setRequestEntity(entity);
    // consult documentation for your web service
    post.setRequestHeader("SOAPAction", strSoapAction);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
      int result = httpclient.executeMethod(post);
      // Display status code
      System.out.println("Response status code: " + result);
      // Display response
      System.out.println("Response body: ");

      if (isBeautify) {
        System.out.println(PostSOAP.beautify(post
            .getResponseBodyAsStream()));
      } else {
        System.out.println(post.getResponseBodyAsString());
      }
    } finally {
      // Release current connection to the connection pool once you are done
      post.releaseConnection();
    }
  }

  public static String beautify(InputStream response) {
    StringWriter sFormattedXML = new StringWriter();

    try {
      Document oDocument = DocumentBuilderFactory.newInstance()
          .newDocumentBuilder().parse(response);
      OutputFormat format = new OutputFormat(oDocument, "UTF-8", true);
      format.setIndent(4);
      format.setIndenting(true);
      format.setPreserveSpace(false);

      XMLSerializer serial = new XMLSerializer(sFormattedXML, format);
      serial.asDOMSerializer();
      serial.serialize(oDocument.getDocumentElement());
    } catch (Exception e) {
      e.printStackTrace();
    }

    return sFormattedXML.toString();
  }
}

Apache HTTP Client의 예제 중 하나인 PostSOAP에 XML을 예쁘게 보여주는 beautify(InputStream) method를 추가했습니다. 참고로

import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;

이 두 import문에서의 OutputFormat, XMLSerializer의 package 이름은 IBM JDK 1.5(J9 VM이라고도 하죠)에 들어있는 Xerces의 OutputFormat이나 XMLSerializer의 package 이름을 따른 것입니다. 흔히들 많이 쓰는 Sun JDK의 Xerces는 package 구조를 Sun이 손을 댄 통에 package 이름이 다릅니다. 따라서 Sun JDK에서는 위 import문을 아래와 같이 바꾸세요.
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;

:
Posted by 하얀 말
2008. 8. 26. 04:31

하얀말의 미투데이 - 2008년 8월 25일 篇隣2008. 8. 26. 04:31

  • 지킬 것 투성이다. 일본으로부터는 독도,동해,중국에게서는 고구려,이어도,백두산,더 나아가 만주,친일파들에게서는 대한민국 임시정부의 법통… 어쩌다 이 지경일까?(독도 동해 고구려 이어도 백두산 만주 대한민국임시정부 역사의식)2008-08-25 16:04:50
  • WIPI 존폐 여부, 충분한 논의 이뤄지고 있나에서 임성순 WIPI협회장은 “과거 정통부는 산업에 무게중심을 두고 정책을 추진해 왔다면, 현재 방통위는 소비자 쪽에 무게 중심을 두는 것 같다”고 했다는데 사실이라면 그 점에 있어 방통위는 정통부보단 낫다.(소비자위주정책 방통위 정통부 WIPI)2008-08-25 16:18:01

이 글은 하얀말님의 2008년 8월 25일의 미투데이 내용입니다.

:
Posted by 하얀 말
2008. 8. 10. 04:31

하얀말의 미투데이 - 2008년 8월 9일 篇隣2008. 8. 10. 04:31

이 글은 하얀말님의 2008년 8월 9일의 미투데이 내용입니다.

:
Posted by 하얀 말
2008. 8. 7. 00:06

엄청 늦은 posting - Kung Fu Panda 영화2008. 8. 7. 00:06

사용자 삽입 이미지

Yesterday is a history,

tomorrow is a mystery,

today is a gift.

That's why we call it the present.


재미도 있고 생각보다 수준 있는 애니메이션이었다.

:
Posted by 하얀 말
2008. 8. 2. 04:31

하얀말의 미투데이 - 2008년 8월 1일 篇隣2008. 8. 2. 04:31

  • "2008 국방부 선정 불온서적 23선 공개? 어허허허~(대략어이없음 시대가완전히거꾸로야)2008-08-01 21:13:21

이 글은 하얀말님의 2008년 8월 1일의 미투데이 내용입니다.

:
Posted by 하얀 말
2008. 7. 29. 04:31

하얀말의 미투데이 - 2008년 7월 28일 篇隣2008. 7. 29. 04:31

이 글은 하얀말님의 2008년 7월 27일의 미투데이 내용입니다.

:
Posted by 하얀 말