# 현재 조판부호 보기 상태 확인하는 함수를 만들어보았습니다

**URL:** <https://forum.developer.hancom.com/t/topic/504>\
**Category:** 한글 컨트롤\
**Created:** [2월 26, 2023, 4:25오후 UTC](https://forum.developer.hancom.com/t/topic/504 "2023-02-26T16:25:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev.community](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/dev.community/32/488_2.png) [@dev.community](https://forum.developer.hancom.com/u/dev.community)\
**Post date:** [2월 26, 2023, 4:25오후 UTC](https://forum.developer.hancom.com/t/topic/504/1 "2023-02-26T16:25:28Z")

</div>

_(예전 커뮤니티(2016-2022) 사이트에서 옮겨온 글입니다: [번호 245](https://www.hancom.com/board/devcommView.do?board_seq=48&artcl_seq=11738))_

작성자: martinii.fun  
날짜: 2022-12-27

—

[https://martinii.fun/375](https://martinii.fun/375)

#### 댓글

##### martinii.fun (2022.12.27)

(본문이 깨져서 댓글로)

한/글 API에는 조판부호 보기 상태를 토글하는 명령어만 존재하는데,  
조판부호가 보이는 상태에서 특정 컨트롤이 글자 칸수를 열 칸 이상 잡아먹는 점을 이용해서  
간단한 함수를 구현해보았습니다.  
제가 사용한 컨트롤은 고정폭 빈칸인데,  
조판부호 보기 상태에서는 14칸을  
조판부호 숨겨진 상태에서는 한 칸을 먹습니다.

KeyIndicator로 현재 칸수와, 고정폭빈칸 추가 후 칸수를 비교해서  
14칸 차이가 나면 “조판부호 보이기 상태”  
그렇지 않으면 "조판부호 숨겨진 상태"로 판단하는 프로세스입니다.  
다소 조악하고, 꼼수 같은 방법이지만;;;  
개인적으로는 잘 활용하게 될 것 같습니다.
